rspec_api_documentation
rspec_api_documentation copied to clipboard
Display type of response_field
I have defined my response fields like this:
response_field :id, "ID of the logged in user", "Type" => "Integer"
response_field :email, "E-mail address", "Type" => "String"
response_field :first_name, "First name", "Type" => "String"
response_field :last_name, "Last name", "Type" => "String"
response_field :role, "Role of the user. This can be: trainee or company_admin", "Type" => "String"
response_field :language, "Language of the user. This can be: nl or fr", "Type" => "String"
response_field :id, "ID of the company the user belongs to", "Type" => "Integer", :scope => :company
response_field :name, "Name of the company the user belongs to", "Type" => "String", :scope => :company
response_field :id, "ID of the function of the user", "Type" => "Integer", :scope => :function
response_field :name, "Name of the function of the user", "Type" => "String", :scope => :function
In the generated documentation the types aren't being displayed. Why is this?
Which format are you using and are you using a viewer like raddocs or apitome?
@oestrich I generate the docs like this:
rspec spec/api/ --format RspecApiDocumentation::ApiFormatter
and view them in the browser.
RspecApiDocumentation.configure do |config|
config.docs_dir = Rails.root.join("public", "api")
config.format = [:json, :combined_text, :html]
config.curl_host = 'https://www.trainingtool.be'
config.api_name = "TrainingTool API"
config.request_headers_to_include = ['Content-Type', 'Authorization']
config.response_headers_to_include = []
config.curl_headers_to_filter = ['Host', 'Cookie']
config.request_body_formatter = :json
end
@rept Which version of rspec_api_documentation
are you using? I am using version 4.6.0
and it works as expected.