File tree Expand file tree Collapse file tree 2 files changed +1
-48
lines changed Expand file tree Collapse file tree 2 files changed +1
-48
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ type Definition struct {
4848 AdditionalProperties any `json:"additionalProperties,omitempty"`
4949 // Whether the schema is nullable or not.
5050 Nullable bool `json:"nullable,omitempty"`
51- // MaxContains specifies the maximum number of elements in an array that can match the schema.
51+ // MinContains specifies the minimum number of elements in an array that can match the schema.
5252 MinContains int `json:"minContains,omitempty"`
5353}
5454
Original file line number Diff line number Diff line change @@ -329,53 +329,6 @@ func TestStructToSchema(t *testing.T) {
329329 "additionalProperties":false
330330 }` ,
331331 },
332- {
333- name : "Test with exclude mark" ,
334- in : struct {
335- Name string `json:"-"`
336- }{
337- Name : "Name" ,
338- },
339- want : `{
340- "type":"object",
341- "additionalProperties":false
342- }` ,
343- },
344- {
345- name : "Test with no json tag" ,
346- in : struct {
347- Name string
348- }{
349- Name : "" ,
350- },
351- want : `{
352- "type":"object",
353- "properties":{
354- "Name":{
355- "type":"string"
356- }
357- },
358- "required":["Name"],
359- "additionalProperties":false
360- }` ,
361- },
362- {
363- name : "Test with omitempty tag" ,
364- in : struct {
365- Name string `json:"name,omitempty"`
366- }{
367- Name : "" ,
368- },
369- want : `{
370- "type":"object",
371- "properties":{
372- "name":{
373- "type":"string"
374- }
375- },
376- "additionalProperties":false
377- }` ,
378- },
379332 }
380333
381334 for _ , tt := range tests {
You can’t perform that action at this time.
0 commit comments