DEV: Use json schema file to describe update group endpoint (#17825)
Updating another endpoint in our api docs to use json schema files for describing the request/response bodies.
This commit is contained in:
parent
f7e7f9a6a7
commit
ec54777f4c
|
@ -60,17 +60,9 @@ RSpec.describe 'groups' do
|
||||||
operationId 'updateGroup'
|
operationId 'updateGroup'
|
||||||
consumes 'application/json'
|
consumes 'application/json'
|
||||||
parameter name: :id, in: :path, type: :integer
|
parameter name: :id, in: :path, type: :integer
|
||||||
parameter name: :group, in: :body, schema: {
|
|
||||||
type: :object,
|
expected_request_schema = load_spec_schema('group_create_request')
|
||||||
properties: {
|
parameter name: :params, in: :body, schema: expected_request_schema
|
||||||
group: {
|
|
||||||
type: :object,
|
|
||||||
properties: {
|
|
||||||
name: { type: :string },
|
|
||||||
}, required: ['name']
|
|
||||||
}
|
|
||||||
}, required: ['group']
|
|
||||||
}
|
|
||||||
|
|
||||||
produces 'application/json'
|
produces 'application/json'
|
||||||
response '200', 'success response' do
|
response '200', 'success response' do
|
||||||
|
@ -79,7 +71,7 @@ RSpec.describe 'groups' do
|
||||||
}
|
}
|
||||||
|
|
||||||
let(:id) { Fabricate(:group).id }
|
let(:id) { Fabricate(:group).id }
|
||||||
let(:group) { { name: 'awesome' } }
|
let(:params) { { 'group' => { 'name' => 'awesome' } } }
|
||||||
|
|
||||||
run_test!
|
run_test!
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue