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

Use additionalProperties instead of patternProperties #39

Merged
merged 2 commits into from
Sep 6, 2023

Conversation

arvidfm
Copy link
Contributor

@arvidfm arvidfm commented Aug 4, 2022

This PR changes how Go maps with non-integer keys are represented by jsonschema to use additionalProperties instead of patternProperties, which is more semantically appropriate and easier to read. (It also happens to be what is supported by redocly-cli at the moment, see Redocly/redocly-cli#792.)

@davidebianchi
Copy link

davidebianchi commented Nov 16, 2022

Hi all, is this PR blocked for some reason? I'd like to have this, if needed also with some options to enable or not the additionalProperties field instead of the patternProperties. In my use case, I created gswagger based on this lib to generate OpenAPI spec based on struct.

OpenAPI spec <3.1 does not support the patternProperties keyword, so using additionalProperties (which is also more easy to read for this use case instead of the pattern .*) would help to have more complete API documentation. Thank you!

Copy link
Contributor

@samlown samlown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about the delay there! This makes a lot of sense. Thanks!

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