Skip to content

additionalProperties: true should be disallowed, flagged as a warning #2030

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

Closed
tedepstein opened this issue Dec 12, 2016 · 3 comments
Closed

Comments

@tedepstein
Copy link

tedepstein commented Dec 12, 2016

#174 has a somewhat broad-ranging discussion about various allOf and additionalProperties limitations that SwagEdit should be aware of, and should help with by adding validations and helpful messages.

One of these is simple, and should not get lost in the overall discussion, so I'm adding it here as a separate issue:

additionalProperties: true and false are meaningless in Swagger 2.0, and should not be allowed.

Note that this is allowed, according to the Swagger specification, and according to the standard JSON Schema for Swagger. Ron Ratovsky says here that this was an oversight in the specification. It wasn't supposed to have been supported. But I think we have to go by the spec, not by after-the-fact comments.

The reason for the warning is because it's totally ignored by the Swagger core libraries. There's nothing downstream of the editor that will recognize a value of true.

@fehguy
Copy link
Contributor

fehguy commented Dec 24, 2016

OK, but swagger-core models don't allow additionalProperties: true. I think this would belong in the swagger-parser.

@fehguy
Copy link
Contributor

fehguy commented Dec 24, 2016

Track swagger-api/swagger-parser#366 for further updates on this.

@fehguy fehguy closed this as completed Dec 24, 2016
@tedepstein
Copy link
Author

@fehguy , sorry, I meant to post this issue in SwagEdit. But yes, it would be good for Swagger-Parser to disallow it.

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

No branches or pull requests

2 participants