fix: update validation tests for comparison rules and adjust schema definitions#12
Open
BaoDuong254 wants to merge 1 commit into
Open
fix: update validation tests for comparison rules and adjust schema definitions#12BaoDuong254 wants to merge 1 commit into
BaoDuong254 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Implement missing comparison validator constraints and fix incorrect schema generation for
eq_ignore_case,ne,ne_ignore_case,gt,gte,lt, andltevalidate tags.eq_ignore_casevalidator to generate a case-insensitivepatterninstead ofenum.nevalidator to generatenot: { enum: [...] }for integer, number, string, boolean, and array types.ne_ignore_casevalidator to generatenot: { pattern: "^(?i)(...)$" }instead of incorrect schema.gt/gtevalidators to generateminimumwithexclusiveMinimumfor integers/numbers,minLengthfor strings, andminItemsfor arrays.lt/ltevalidators to generatemaximumwithexclusiveMaximumfor integers/numbers,maxLengthfor strings, andmaxItemsfor arrays.Not *SchemaObjectfield toSchemaObjectto support the OpenAPInotkeyword.minimum/maximumnever being serialized:NumberandIntegerembedded structs had conflicting JSON field names, causingencoding/jsonto silently drop both fields — resolved by movingminimum,maximum,exclusiveMinimum, andexclusiveMaximumdirectly ontoSchemaObject.ucharacter syntax error invalidate_comparision_test.go.lte=5on string should producemaxLength: 5, not6.float64format should be"float64"not"double"to match existing behavior.Type of change