swagger-blocks
swagger-blocks copied to clipboard
Support overriding keys inline
In order to clean up my documentation I have used parameter referencing as much as possible. However it seems that there's no easy way of overriding attributes that are set in the parameter when it's defined.
An example is that I create the following id
parameter and reference it throughout my documentation - but I would like to be more specific in the description.
This however seems to go for all keys and not just description.
# Swagger definition
swagger_root do
# ...
parameter :id do
key :in, :path
key :name, :id
key :description, 'ID of resource to fetch.'
key :required, true
key :type, :integer
end
# ...
end
# In controller
swagger_path '/cats/{id}' do
operation :get do
# ...
parameter :id do
key :description, 'ID of Cat record to fetch'
end
end
end
Is there any way to achieve the desired effect?
Same issue here
# I want to reference this schema in Country, but the id in Country schema is not shown
swagger_schema :CountryBase do
property :type do
key :type, :string
end
property :attributes do
property :code do
key :type, :string
end
property :name do
key :type, :string
end
property :phone do
key :type, :string
end
property :deleted do
key :type, :boolean
end
end
end
# Country does not show id
swagger_schema :Country do
property :id do
key :type, :integer
key :format, :int64
end
key :'$ref', :CountryBase
end