Skip to content

Initial support for enum property validations#29

Merged
bflad merged 3 commits intomainfrom
bflad/enum
Jul 6, 2023
Merged

Initial support for enum property validations#29
bflad merged 3 commits intomainfrom
bflad/enum

Conversation

@bflad
Copy link
Copy Markdown
Contributor

@bflad bflad commented Jul 3, 2023

Closes #18

If the OpenAPI specification declares the enum property and the attribute is determined to be configurable, adds the validator to the specification output.

Reference: #18

If the OpenAPI specification declares the `enum` property and the attribute is determined to be configurable, adds the validator to the specification output.
@bflad bflad added the enhancement New feature or request label Jul 3, 2023
@bflad bflad requested a review from a team as a code owner July 3, 2023 21:32
Copy link
Copy Markdown
Contributor

@bendbennett bendbennett left a comment

Choose a reason for hiding this comment

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

Sweet.
I like the look of this a lot.

Copy link
Copy Markdown
Member

@austinvalle austinvalle left a comment

Choose a reason for hiding this comment

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

Awesome! 👍🏻 - Two questions:

  • Can/should we implement similar mappings for Float64Attribute and NumberAttribute enum validators?
  • Should we write a blurb about this mapping in the DESIGN.md? I've been trying to keep it up-to-date so whenever we create official docs we don't need to dig through the code for these features. Could also just list this in it's own "documentation" issue, instead.

@bflad
Copy link
Copy Markdown
Contributor Author

bflad commented Jul 6, 2023

Can/should we implement similar mappings for Float64Attribute and NumberAttribute enum validators?

Probably. 😄 Will update.

EDIT: I'm not sure about NumberAttribute as the representation in OAS and the specification JSON might get funky.

Should we write a blurb about this mapping in the DESIGN.md?

If that makes sense, sure. You'll note though that I'm trying to create a lot of issues to achieve "full" parity where we can. At a certain point it might make more sense to say (or leave as open issues) what's not supported in JSON Schema/OAS. I guess we can cross that bridge when we get there though. I'll update the design doc.

@bflad bflad merged commit fe37999 into main Jul 6, 2023
@bflad bflad deleted the bflad/enum branch July 6, 2023 14:55
@github-actions
Copy link
Copy Markdown

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators May 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support OAS enum Property as Attribute Validator

3 participants