fix: Recursive tag application for array fields#101
Conversation
|
@samlown this is one of the things uncovered during the schema gen for CloudQuery. |
samlown
left a comment
There was a problem hiding this comment.
It'd be great to just set up a specific test rather than updating the TestUser. There are examples at the bottom of reflect_test.go.
reflect_test.go
Outdated
| MinLen []string `json:"min_len" jsonschema:"minLength=2"` | ||
| MinVal []float64 `json:"min_val" jsonschema:"minimum=2.5"` |
There was a problem hiding this comment.
The way I'm pushing for tests here now is to define a separate and independent test rather than updating the massive TestUser. This reduces the number of updated test JSON files. What that be possible here?
There was a problem hiding this comment.
Done in 6f92551.
Additionally, I removed recursive array ([][]... case) tags application per the impossibility of making decision where the tags belong to. This might lead to issue with [][]string jsonschema:"minLength=1"` not handled properly, but I think it's fine for now.
|
@samlown I've stumbled upon an interesting regression from this change, I'll make a follow-up PR (it's related to |
Prior to this fix
minLengthwould've been missing from the[]stringfield