[VAULT-5887] TypeInt64 support added to OpenApi Spec generation (#15104)

Adding handling for TypeInt64 to OAS types
This commit is contained in:
AnPucel 2022-04-22 15:37:12 -07:00 committed by GitHub
parent 2907464b96
commit f38248f5e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 0 deletions

3
changelog/15104.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:bug
sdk: Fix OpenApi spec generator to properly convert TypeInt64 to OAS supported int64
```

View File

@ -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"

View File

@ -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",

View File

@ -113,6 +113,11 @@
"type": "string",
"description": "a header value",
"enum": ["a", "b", "c"]
},
"maximum" : {
"type": "integer",
"description": "a maximum value",
"format": "int64"
}
}
}