Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sdghchj committed Dec 11, 2024
1 parent ecbb8cb commit d3de366
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 10 deletions.
1 change: 1 addition & 0 deletions operation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1619,6 +1619,7 @@ func TestParseParamCommentByFormDataTypeUint64(t *testing.T) {
expected := `[
{
"type": "integer",
"format": "int64",
"description": "this is a test file",
"name": "file",
"in": "formData",
Expand Down
9 changes: 6 additions & 3 deletions parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1332,7 +1332,8 @@ func TestParseSimpleApi_ForSnakecase(t *testing.T) {
"type": "integer"
},
"err": {
"type": "integer"
"type": "integer",
"format": "int32"
},
"status": {
"type": "boolean"
Expand Down Expand Up @@ -1788,7 +1789,8 @@ func TestParseSimpleApi_ForLowerCamelcase(t *testing.T) {
"type": "integer"
},
"err": {
"type": "integer"
"type": "integer",
"format": "int32"
},
"status": {
"type": "boolean"
Expand Down Expand Up @@ -1947,7 +1949,8 @@ func TestParseStructComment(t *testing.T) {
},
"errorNo": {
"description": "Error ` + "`" + `number` + "`" + ` tick comment",
"type": "integer"
"type": "integer",
"format": "int64"
}
}
}
Expand Down
12 changes: 8 additions & 4 deletions testdata/generics_basic/expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -354,15 +354,17 @@
"originMapField": {
"type": "object",
"additionalProperties": {
"type": "number"
"type": "number",
"format": "float64"
}
}
}
},
"types.MapField-string-float64": {
"type": "object",
"additionalProperties": {
"type": "number"
"type": "number",
"format": "float64"
}
},
"types.MapFieldNestedStruct-string": {
Expand All @@ -375,7 +377,8 @@
"type": "object",
"properties": {
"f": {
"type": "number"
"type": "number",
"format": "float64"
},
"s": {
"type": "string"
Expand Down Expand Up @@ -431,7 +434,8 @@
},
"errorNo": {
"description": "Error `number` tick comment",
"type": "integer"
"type": "integer",
"format": "int64"
}
}
},
Expand Down
3 changes: 2 additions & 1 deletion testdata/generics_names/expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,8 @@
},
"errorNo": {
"description": "Error `number` tick comment",
"type": "integer"
"type": "integer",
"format": "int64"
}
}
},
Expand Down
6 changes: 4 additions & 2 deletions testdata/generics_property/expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@
}
},
"items2": {
"type": "integer"
"type": "integer",
"format": "int32"
},
"post": {
"$ref": "#/definitions/types.Field-array_types_Post"
Expand Down Expand Up @@ -444,7 +445,8 @@
}
},
"items2": {
"type": "integer"
"type": "integer",
"format": "int32"
}
}
}
Expand Down

0 comments on commit d3de366

Please sign in to comment.