diff --git a/changelog/15104.txt b/changelog/15104.txt new file mode 100644 index 000000000..39ea1f577 --- /dev/null +++ b/changelog/15104.txt @@ -0,0 +1,3 @@ +```release-note:bug +sdk: Fix OpenApi spec generator to properly convert TypeInt64 to OAS supported int64 +``` diff --git a/sdk/framework/openapi.go b/sdk/framework/openapi.go index 87240ecc8..717a6505d 100644 --- a/sdk/framework/openapi.go +++ b/sdk/framework/openapi.go @@ -613,6 +613,9 @@ func convertType(t FieldType) schemaType { ret.format = "lowercase" case TypeInt: ret.baseType = "integer" + case TypeInt64: + ret.baseType = "integer" + ret.format = "int64" case TypeDurationSecond, TypeSignedDurationSecond: ret.baseType = "integer" ret.format = "seconds" diff --git a/sdk/framework/openapi_test.go b/sdk/framework/openapi_test.go index fa14d2eb8..592406d9f 100644 --- a/sdk/framework/openapi_test.go +++ b/sdk/framework/openapi_test.go @@ -356,6 +356,10 @@ func TestOpenAPI_Paths(t *testing.T) { Description: "a header value", AllowedValues: []interface{}{"a", "b", "c"}, }, + "maximum": { + Type: TypeInt64, + Description: "a maximum value", + }, "format": { Type: TypeString, Description: "a query param", diff --git a/sdk/framework/testdata/operations.json b/sdk/framework/testdata/operations.json index 94d54087b..097399c02 100644 --- a/sdk/framework/testdata/operations.json +++ b/sdk/framework/testdata/operations.json @@ -113,6 +113,11 @@ "type": "string", "description": "a header value", "enum": ["a", "b", "c"] + }, + "maximum" : { + "type": "integer", + "description": "a maximum value", + "format": "int64" } } }