Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from Apr 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelog/15104.txt
@@ -0,0 +1,3 @@
```release-note:bug
sdk: Fix OpenApi spec generator to properly convert TypeInt64 to OAS supported int64
```
3 changes: 3 additions & 0 deletions sdk/framework/openapi.go
Expand Up @@ -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"
Expand Down
4 changes: 4 additions & 0 deletions sdk/framework/openapi_test.go
Expand Up @@ -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",
Expand Down
5 changes: 5 additions & 0 deletions sdk/framework/testdata/operations.json
Expand Up @@ -113,6 +113,11 @@
"type": "string",
"description": "a header value",
"enum": ["a", "b", "c"]
},
"maximum" : {
"type": "integer",
"description": "a maximum value",
"format": "int64"
}
}
}
Expand Down