Open
Description
Describe the bug
With OAS 2.0 generated JSON of rswag a select box is rendered of enum values for URL parameters. Since I updated to OAS 3 the enum values are not properly processed and no select box is rendered, only an input field. The JSON is generated not as OAS 3 expects it.
Steps to Test or Reproduce
An API with a parameter like described in the following snipped generates a JSON like shown below.
test.rswag_spec.rb:
path '/tests' do
get 'fetch tests' do
parameter name: :test_type, in: :query, type: :string, required: false, enum: ['type1', 'type2']
[...]
end
end
Generates:
...
"parameters": [
{
"name": "test_type",
"in": "query",
"required": false,
"enum": [
"type1",
"type2"
],
"schema": {
"type": "string"
}
}
]
...
Expected behavior
The generated JSON should look like:
...
"parameters": [
{
"name": "test_type",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": [
"type1",
"type2"
]
}
}
]
...
The enum should be in the schema
attribute. Then the select box is rendered on the UI page.
Dependency versions
The version of are you using for:
- Rswag: 2.13.0
- RSpec-core: 3.12.2
- Rails: 7.0.8
- Ruby: 3.2.2
Relates to which version of OAS (OpenAPI Specification)
- OAS2
- OAS3
- OAS3.1
Metadata
Metadata
Assignees
Labels
No labels