mirror of
https://github.com/hashicorp/vault.git
synced 2026-02-03 20:40:45 -05:00
[VAULT-5887] TypeInt64 support added to OpenApi Spec generation (#15104)
Adding handling for TypeInt64 to OAS types
This commit is contained in:
parent
ca9f175126
commit
d569b23c1b
4 changed files with 15 additions and 0 deletions
3
changelog/15104.txt
Normal file
3
changelog/15104.txt
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
```release-note:bug
|
||||
sdk: Fix OpenApi spec generator to properly convert TypeInt64 to OAS supported int64
|
||||
```
|
||||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
5
sdk/framework/testdata/operations.json
vendored
5
sdk/framework/testdata/operations.json
vendored
|
|
@ -113,6 +113,11 @@
|
|||
"type": "string",
|
||||
"description": "a header value",
|
||||
"enum": ["a", "b", "c"]
|
||||
},
|
||||
"maximum" : {
|
||||
"type": "integer",
|
||||
"description": "a maximum value",
|
||||
"format": "int64"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue