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

Validate that example values don't have undefined properties #4

Open
pvdbosch opened this issue Jun 12, 2024 · 0 comments · May be fixed by #50
Open

Validate that example values don't have undefined properties #4

pvdbosch opened this issue Jun 12, 2024 · 0 comments · May be fixed by #50

Comments

@pvdbosch
Copy link
Collaborator

Undefined properties in an example are undesired: if they aren't documented in the associated schema, it doesn't make sense to document them in the example. Undefined properties are usually just an error e.g. typo or after schema refactoring.

The validator could mark this as an error or warning, unless the schema has explicitly additionalProperties set, i.e. similar behavior as atlassian's swagger-request-validator ("validation.schema.additionalProperties" with default ERROR level).

Related discussion: belgif/rest-guide#146 (comment)

Note that the rule [req-valid] does allow undefined properties in responses only, but that's in a different context (API version compatibility vs API documentation)

@smals-mavh smals-mavh linked a pull request Dec 17, 2024 that will close this issue
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 a pull request may close this issue.

1 participant