Document tables arrangements controller #175
@ -9,6 +9,13 @@ module Swagger
|
|||||||
updated_at: SwaggerResponseHelper::TIMESTAMP
|
updated_at: SwaggerResponseHelper::TIMESTAMP
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ID = {
|
||||||
|
name: 'id',
|
||||||
|
in: :path,
|
||||||
|
type: :string,
|
||||||
|
format: :uuid,
|
||||||
|
}
|
||||||
|
|
||||||
GROUP = {
|
GROUP = {
|
||||||
name: { type: :string },
|
name: { type: :string },
|
||||||
icon: { type: :string, example: 'pi pi-crown', description: 'The CSS classes used by the icon' },
|
icon: { type: :string, example: 'pi pi-crown', description: 'The CSS classes used by the icon' },
|
||||||
|
61
spec/requests/tables_arrangements_spec.rb
Normal file
61
spec/requests/tables_arrangements_spec.rb
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
# Copyright (C) 2024 Manuel Bustillo
|
||||||
|
|
||||||
|
require 'swagger_helper'
|
||||||
|
|
||||||
|
RSpec.describe 'tables_arrangements', type: :request do
|
||||||
|
|
||||||
|
path '/{slug}/tables_arrangements' do
|
||||||
|
get('list tables arrangements') do
|
||||||
|
tags 'Tables Arrangements'
|
||||||
|
produces 'application/json'
|
||||||
|
parameter Swagger::Schema::SLUG
|
||||||
|
response(200, 'successful') do
|
||||||
|
schema type: :array,
|
||||||
|
items: {
|
||||||
|
type: :object,
|
||||||
|
required: %i[id name discomfort],
|
||||||
|
properties: {
|
||||||
|
id: { type: :string, format: :uuid },
|
||||||
|
name: { type: :string },
|
||||||
|
discomfort: { type: :integer }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
xit
|
||||||
|
end
|
||||||
|
regular_api_responses
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
path '/{slug}/tables_arrangements/{id}' do
|
||||||
|
get('show tables arrangement') do
|
||||||
|
tags 'Tables Arrangements'
|
||||||
|
produces 'application/json'
|
||||||
|
parameter Swagger::Schema::SLUG
|
||||||
|
parameter Swagger::Schema::ID
|
||||||
|
response(200, 'successful') do
|
||||||
|
schema type: :array,
|
||||||
|
items: {
|
||||||
|
type: :object,
|
||||||
|
required: %i[number guests],
|
||||||
|
properties: {
|
||||||
|
number: { type: :integer },
|
||||||
|
guests: {
|
||||||
|
type: :array,
|
||||||
|
items: {
|
||||||
|
type: :object,
|
||||||
|
required: %i[id name color],
|
||||||
|
properties: {
|
||||||
|
id: { type: :string, format: :uuid },
|
||||||
|
name: { type: :string },
|
||||||
|
color: { type: :string }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
xit
|
||||||
|
end
|
||||||
|
regular_api_responses
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
x
Reference in New Issue
Block a user