28_introduce_rswag #35

Merged
philipp merged 46 commits from 28_introduce_rswag into develop 2023-01-05 13:45:47 +01:00
3 changed files with 17 additions and 11 deletions
Showing only changes of commit 5201d1740c - Show all commits

View file

@ -9,17 +9,8 @@ describe 'Order Articles', type: :request do
produces 'application/json' produces 'application/json'
parameter name: "per_page", in: :query, type: :integer, required: false parameter name: "per_page", in: :query, type: :integer, required: false
parameter name: "page", in: :query, type: :integer, required: false parameter name: "page", in: :query, type: :integer, required: false
parameter name: 'q', in: :query, required: false, q_ordered_url_param
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]
}
}
}
let(:api_scopes) { ['orders:read', 'orders:write'] } let(:api_scopes) { ['orders:read', 'orders:write'] }
let(:order) { create(:order, article_count: 4) } let(:order) { create(:order, article_count: 4) }
let(:order_articles) { order.order_articles } let(:order_articles) { order.order_articles }

View file

@ -70,5 +70,11 @@ module ApiHelper
def self.id_url_param def self.id_url_param
parameter name: :id, in: :path, type: :integer, required: true parameter name: :id, in: :path, type: :integer, required: true
end 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
end end

View file

@ -351,6 +351,15 @@ RSpec.configure do |config|
} }
] ]
}, },
q_ordered: {
type: :object,
properties: {
ordered: {
type: :string,
enum: %w[member all supplier]
}
}
},
Meta: { Meta: {
type: :object, type: :object,
properties: { properties: {