Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

schemaValidation - Improved OpenAPI to JSON schema conversion #644

Merged
merged 3 commits into from
Aug 27, 2024

Conversation

thim81
Copy link
Collaborator

@thim81 thim81 commented Aug 24, 2024

linked to #642 #494

  • Improved OpenAPI to JSON schema conversion to handle OpenAPI-specific properties in correct format
  • strip unneeded OpenAPI-specific properties ('discriminator', 'readOnly', 'writeOnly', 'xml', 'externalDocs', 'example','deprecated') for more compact JSON schemas.
  • Added JSON schema validation warning during conversion, to inform the users.

We don't stop the Portman conversion but skip the JSON Validation injection in Postman, like we did in the past for $ref properties.

This PR also solves a long lasting issue, where the openapi-to-postman converter injected/modified unwanted properties (minItems, maxItems).

CONVERSION WARNING
image

SKIP JSON Validation injection
image

BEFORE
image

AFTER
image

The test snapshot are changed because of the stripping of the unneeded OpenAPI-specific properties.

@thim81
Copy link
Collaborator Author

thim81 commented Aug 24, 2024

@nicklloyd I kept a range of test but skipped them (it.skip) to be removed after we got confirmation from the community/users.

@savage-alex
Copy link

Thanks @thim81 looking forward to it

@thim81 thim81 merged commit 1dc6a68 into main Aug 27, 2024
6 checks passed
@thim81 thim81 deleted the 642-schema branch August 27, 2024 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants