fix: validate min constraint values in openapi #4179
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
About the changes
Previously constraint values were validated inside the feature toggle service not in the openapi. What it means is that change requests that are using the same schema, don't get a validation since it's inside the feature service. So I'm moving the validation of values min length to the openapi schema. Since this field is optional the validation only kicks in when values are provided, not when single value is provided.
Solves: https://linear.app/unleash/issue/1-1095/cr-allows-0-values-for-constraints
Important files
Discussion points