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

[Bug] Comparison of additionalProperties should be fixed #314

Open
allenjzhang opened this issue Mar 28, 2024 · 4 comments
Open

[Bug] Comparison of additionalProperties should be fixed #314

allenjzhang opened this issue Mar 28, 2024 · 4 comments
Assignees

Comments

@allenjzhang
Copy link
Member

... when comparing additionalProperties: true vs additionalProperties: {}.

additionalProperties: true allows any additional properties of any type.
additionalProperties: {} is functionally equivalent to additionalProperties: true, allowing any additional properties without specific schema constraints.

Change between them should not be flagged.

@mikeharder
Copy link
Member

mikeharder commented Mar 28, 2024

@allenjzhang: What is the justification for treating these as equivalent? Can you link to a spec or something that these should be equivalent?

Why are we (or our code generators) switching from true to {}?

Would you say this is really a "bug", or more a "feature request"? Because true and {} are not equivalent in all contexts.

@mikeharder mikeharder self-assigned this Mar 28, 2024
@mikekistler
Copy link
Member

For additionalProperties, true and {} are equivalent. I would classify this as a bug fix though I suppose its arguable.

@mikeharder
Copy link
Member

For additionalProperties, true and {} are equivalent. I would classify this as a bug fix though I suppose its arguable.

Do you have a source for this? Is this something universally true in OpenAPI, or specific to our flavor of OpenAPI?

@mikekistler
Copy link
Member

https://datatracker.ietf.org/doc/html/draft-fge-json-schema-validation-00#section-5.4.4

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📋 Backlog
Development

No branches or pull requests

3 participants