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

feat(oas): validate 'default' in schemas #1429

Merged
merged 2 commits into from
Dec 30, 2020
Merged

Conversation

P0lip
Copy link
Contributor

@P0lip P0lip commented Dec 29, 2020

Closes #1402

Checklist

  • Tests added / updated
  • Docs added / updated

Does this PR introduce a breaking change?

  • Yes
  • No

Additional context

I'm very torn when it comes to the solution chosen here.

Besides what's implemented here, I considered the following:

  • 2 completely new rules called oas2-valid-schema-default and oas3-valid-schema-default - this might cause redundant fragmentation
  • renaming existing rules to something more generic, i.e. oas2-valid-schema (wouldn't it be confusing, though?) - this one would be breaking and therefore defer the release of the fix

I still think that ideally we should rename the rules, so that we can validate more things in the future using the same rule.
I'm not fully certain, however, so hm... @philsturgeon ideas?

@P0lip P0lip added the enhancement New feature or request label Dec 29, 2020
@P0lip P0lip requested a review from philsturgeon December 29, 2020 23:25
@P0lip P0lip self-assigned this Dec 29, 2020
Copy link
Contributor

@philsturgeon philsturgeon left a comment

Choose a reason for hiding this comment

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

I think its ok to have it in default for now, its really similar. Only example and default work this way, so making a more generic oasX-valid-schema would just end up causing future bloat I think. If people report being confused by this we can split the rules but there's far bigger fish to fry I think.

@P0lip P0lip enabled auto-merge (squash) December 30, 2020 21:54
@P0lip P0lip merged commit cdf7f8c into develop Dec 30, 2020
@P0lip P0lip deleted the fix/validate-schema-enum branch December 30, 2020 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Linter is missing non existing enums in the default
2 participants