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 required + default properties #345

Open
sebas-intellegens opened this issue Dec 3, 2021 · 1 comment
Open

Validate required + default properties #345

sebas-intellegens opened this issue Dec 3, 2021 · 1 comment

Comments

@sebas-intellegens
Copy link

using petstore.yaml
and the "required_param_has_default": "error" config option

adding default: some_string here on a parameter and running lint-openapi does correctly return an error

however setting default: some_string here on a property does not return a error

the config option "required_param_has_default": "error" refers to param so I guess this excludes request body objects etc (?)
if so, I was wondering if this is something that makes sense to add (because it seems equally incorrect on a param and request body object's prop)?

(I'm using version 0.51.3)

@dpopp07
Copy link
Member

dpopp07 commented Aug 9, 2022

@sebas-intellegens Apologies for the late reply here. That's certainly worth considering, though we currently have a suite of higher-priority rules we're implementing and don't have much extra bandwidth. If this is important for your use case in the short term, I recommend extending our ruleset with a custom rule that enables this enforcement.

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