Skip to content

Commit

Permalink
fix: namespaces for default responses
Browse files Browse the repository at this point in the history
  • Loading branch information
deniskorobicyn committed Jun 28, 2017
1 parent 0cc731e commit 96ff1ea
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 40 deletions.
16 changes: 9 additions & 7 deletions app/docs/swagger/v1/default_responses/bad_request.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
module Swagger
module DefaultResponses
module BadRequest
def self.extended(base)
base.response 400 do
key :description, "Переданные параметры не могут быть обработаны"
schema do
key :'$ref', :'Swagger::V1::::Models::Apress::Api::UnprocessableError'
module V1
module DefaultResponses
module BadRequest
def self.extended(base)
base.response 400 do
key :description, "Переданные параметры не могут быть обработаны"
schema do
key :'$ref', :'Swagger::V1::::Models::Apress::Api::UnprocessableError'
end
end
end
end
Expand Down
16 changes: 9 additions & 7 deletions app/docs/swagger/v1/default_responses/not_found.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
module Swagger
module DefaultResponses
module NotFound
def self.extended(base)
base.response 404 do
key :description, "Запрашиваемый ресурс не найден"
schema do
key :'$ref', :'Swagger::V1::::Models::Apress::Api::SimpleError'
module V1
module DefaultResponses
module NotFound
def self.extended(base)
base.response 404 do
key :description, "Запрашиваемый ресурс не найден"
schema do
key :'$ref', :'Swagger::V1::::Models::Apress::Api::SimpleError'
end
end
end
end
Expand Down
16 changes: 9 additions & 7 deletions app/docs/swagger/v1/default_responses/unauthenticated.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
module Swagger
module DefaultResponses
module Unauthenticated
def self.extended(base)
base.response 401 do
key :description, "Запрос не прошел аутентификацию (проблема с подписью запроса)"
schema do
key :'$ref', :'Swagger::V1::::Models::Apress::Api::SimpleError'
module V1
module DefaultResponses
module Unauthenticated
def self.extended(base)
base.response 401 do
key :description, "Запрос не прошел аутентификацию (проблема с подписью запроса)"
schema do
key :'$ref', :'Swagger::V1::::Models::Apress::Api::SimpleError'
end
end
end
end
Expand Down
16 changes: 9 additions & 7 deletions app/docs/swagger/v1/default_responses/unauthorized.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
module Swagger
module DefaultResponses
module Unauthorized
def self.extended(base)
base.response 403 do
key :description, "Нет доступа к ресурсу"
schema do
key :'$ref', :'Swagger::V1::::Models::Apress::Api::SimpleError'
module V1
module DefaultResponses
module Unauthorized
def self.extended(base)
base.response 403 do
key :description, "Нет доступа к ресурсу"
schema do
key :'$ref', :'Swagger::V1::::Models::Apress::Api::SimpleError'
end
end
end
end
Expand Down
16 changes: 9 additions & 7 deletions app/docs/swagger/v1/default_responses/unprocessable.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
module Swagger
module DefaultResponses
module Unprocessable
def self.extended(base)
base.response 422 do
key :description, "Переданные параметры не валидны"
schema do
key :'$ref', :'Swagger::V1::::Models::Apress::Api::UnprocessableError'
module V1
module DefaultResponses
module Unprocessable
def self.extended(base)
base.response 422 do
key :description, "Переданные параметры не валидны"
schema do
key :'$ref', :'Swagger::V1::::Models::Apress::Api::UnprocessableError'
end
end
end
end
Expand Down
12 changes: 7 additions & 5 deletions app/docs/swagger/v1/default_responses/updates_locked.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
module Swagger
module DefaultResponses
module UpdatedLocked
def self.extended(base)
base.response 503 do
key :description, "Закрыто редактирование"
module V1
module DefaultResponses
module UpdatedLocked
def self.extended(base)
base.response 503 do
key :description, "Закрыто редактирование"
end
end
end
end
Expand Down

0 comments on commit 96ff1ea

Please sign in to comment.