28_introduce_rswag #35
3 changed files with 17 additions and 11 deletions
|
@ -9,17 +9,8 @@ describe 'Order Articles', type: :request do
|
|||
produces 'application/json'
|
||||
parameter name: "per_page", in: :query, type: :integer, required: false
|
||||
parameter name: "page", in: :query, type: :integer, required: false
|
||||
parameter name: 'q', in: :query, required: false,
|
||||
description: "'member' show articles ordered by the user's ordergroup, 'all' by all members, and 'supplier' ordered at the supplier",
|
||||
schema: {
|
||||
type: :object,
|
||||
properties: {
|
||||
ordered: {
|
||||
type: :string,
|
||||
enum: %w[member all supplier]
|
||||
}
|
||||
}
|
||||
}
|
||||
q_ordered_url_param
|
||||
|
||||
let(:api_scopes) { ['orders:read', 'orders:write'] }
|
||||
let(:order) { create(:order, article_count: 4) }
|
||||
let(:order_articles) { order.order_articles }
|
||||
|
|
|
@ -70,5 +70,11 @@ module ApiHelper
|
|||
def self.id_url_param
|
||||
parameter name: :id, in: :path, type: :integer, required: true
|
||||
end
|
||||
|
||||
def self.q_ordered_url_param
|
||||
parameter name: 'q', in: :query, required: false,
|
||||
description: "'member' show articles ordered by the user's ordergroup, 'all' by all members, and 'supplier' ordered at the supplier",
|
||||
schema: { '$ref' => '#/components/schemas/q_ordered' }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -351,6 +351,15 @@ RSpec.configure do |config|
|
|||
}
|
||||
]
|
||||
},
|
||||
q_ordered: {
|
||||
type: :object,
|
||||
properties: {
|
||||
ordered: {
|
||||
type: :string,
|
||||
enum: %w[member all supplier]
|
||||
}
|
||||
}
|
||||
},
|
||||
Meta: {
|
||||
type: :object,
|
||||
properties: {
|
||||
|
|
Loading…
Reference in a new issue