rspec_api_documentation
rspec_api_documentation copied to clipboard
Only one required parameter showing as required (Open API writer)
with_options scope: :user, type: :string, , required: true, with_example: true do
parameter :email, 'User email (login)'
parameter :password, 'Plain password'
end
or even
with_options scope: :user, type: :string, with_example: true do
parameter :email, 'User email (login)', required: true
parameter :password, 'Plain password', required: true
end
only outputs email as required in the open_api output.
with_options scope: :user, type: :string, with_example: true do
parameter :email, 'User email (login)',
parameter :password, 'Plain password', required: true
end
shows password properly as required. So it seems only one item can be marked as required in the open_api writer.
Having the same problem. I even tried adding parameters without #with_options method, it didn't work anyway. Only the first parameter, which is marked as required, will be added to the list of required fields in the generated JSON.
The problem seems to be on how extract_schema is leading with multiple fields on the OpenApiWriter