carvel-dev / ytt

YAML templating tool that works on YAML structure instead of text
https://carvel.dev/ytt
Apache License 2.0
1.66k stars 135 forks source link

Export named validations to openApi properties #899

Closed peschmae closed 5 months ago

peschmae commented 6 months ago

This pull requests, exposes the attributes for the named #@schema/validations to the openApi schema, where a direct mapping is possible.

Type ytt validation openapi validation
string min_len minLength
string max_len maxLength
integer min minimum
integer max maximum
any one_of enum

The PR includes tests for all those validations.

Fixes #897

prembhaskal commented 6 months ago

will try to review this week.

peschmae commented 6 months ago

Just saw the linting errors, and will look into them.

Should I squash my commits and force push, or is it fine to have mutliple commits, and the will be squashed when merged?

prembhaskal commented 5 months ago

you can have multiple commits and then squash them before merging.

peschmae commented 5 months ago

Any change to get a review on this? Compared to #901 this is a smaller change and would allow to integrate the conversion from openapi to json schema, in a separate tool if the other PR wouldn't be merged.

peschmae commented 5 months ago

Ammended whitespace cleanup into latest commit, and force pushed