rspec_api_documentation icon indicating copy to clipboard operation
rspec_api_documentation copied to clipboard

Display type of response_field

Open rept opened this issue 8 years ago • 3 comments

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?

rept avatar May 26 '16 14:05 rept

Which format are you using and are you using a viewer like raddocs or apitome?

oestrich avatar Jun 16 '16 15:06 oestrich

@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 avatar Jun 16 '16 15:06 rept

@rept Which version of rspec_api_documentation are you using? I am using version 4.6.0 and it works as expected.

Shwetakale avatar Jun 29 '16 05:06 Shwetakale