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

Export validation annotations in openapi schema #897

Closed
peschmae opened this issue Mar 25, 2024 · 1 comment · Fixed by #899
Closed

Export validation annotations in openapi schema #897

peschmae opened this issue Mar 25, 2024 · 1 comment · Fixed by #899
Labels
enhancement This issue is a feature request

Comments

@peschmae
Copy link
Contributor

Describe the problem/challenge you have
Currently the openapi schema generated using ytt -f schema.yaml --data-values-schema-inspect --output openapi-v3 is missing any of the #@schema/validation rules.

Describe the solution you'd like
Exporting the openapi-v3 schema, should include the named rules since they all seem to be relatively easy to map to openapi-v3.

Type ytt validation openapi validation
string min_len minLength
string max_len maxLength
integer min minimum
integer max. maximum
any not_null=(nullable) nullable=true
any one_of enum

Only one_not_null seems to be a bit more complicate to map, and could be left out.


Vote on this request

This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.

👍 "I would like to see this addressed as soon as possible"
👎 "There are other more important things to focus on right now"

We are also happy to receive and review Pull Requests if you want to help working on this issue.

@peschmae peschmae added carvel triage This issue has not yet been triaged for relevance enhancement This issue is a feature request labels Mar 25, 2024
@peschmae
Copy link
Contributor Author

Just realized #@schema/nullable is converted to the corresponding attribute in openapi, but the not_null validation isn't.

Since the not_null validation, is documented mostly with additional lambda condition, this could also be left out.

@github-actions github-actions bot removed the carvel triage This issue has not yet been triaged for relevance label Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This issue is a feature request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant