Questions tagged [rspec-api-documentation]

A Ruby gem used most often with Ruby on Rails applications. It allows one to generate pretty API documentations using RSpec syntax.

Github: https://github.com/zipmark/rspec_api_documentation

Relish documentation: http://www.relishapp.com/zipmark/rspec-api-documentation/docs

19 questions
7
votes
1 answer

API versioning with rspec_api_documentation and apitome

We are using rspec_api_documentation and managed to generate the documentation for the 2 versions we have so far with the following code: RspecApiDocumentation.configure do |config| config.docs_dir = Rails.root.join('doc', 'api', 'all') …
rebagliatte
  • 2,110
  • 1
  • 20
  • 25
4
votes
1 answer

rspec_api_documentation - How to have multiple examples

My goal is to show multiple examples of parameters and responses using rspec_api_documentation with rswag-ui or by adding swagger-ui directly to the project. I'm having some trouble generating the correct open_api.json with my config and am…
isuPatches
  • 6,384
  • 2
  • 22
  • 30
3
votes
1 answer

rspec_api_documentation - undefined method `call' for nil:NilClass

I've just started using rspec_api_documentation and cannot get it to work with my api. Created simple spec, as basic as first example in the readme but it keeps throwing undefined method 'call' for nil:NilClass error at me, and I have no idea what…
mswiszcz
  • 980
  • 1
  • 8
  • 26
3
votes
3 answers

Is there a way to manually serialize a collection?

I'd like to manually serialize a collection for testing purposes. I tried this: JSONAPI::ResourceSerializer.new(PostResource). serialize_to_hash(PostResource.new(Post.all)) This doesn't work. It appears you can only serialize a single resource…
2
votes
0 answers

Is it possible to set the scham protocol to 'https' for only RspecApiDocumentation in specs?

I want to render these through Apitome but they only return http. I'm able to set the other headers with: header 'Authorization', 'Token token=secret' header 'Content-Type', 'application/vnd.api+json' header 'Host',…
2
votes
1 answer

rspec-api-documentation gem shows `[binary data]` instead of the response body

While using the rspec-api-documentation gem in markdown mode (config.format = [:markdown]) I noticed that the documentation generated is lacking the response body. Is there a permanent fix for this?
Viktor
  • 2,623
  • 3
  • 19
  • 28
2
votes
1 answer

Using RSpec API Documentation Generator, can I pretty print the request body JSON?

I'm using the RSpec API Documentation Generator Gem for my rails app, and when I generate the docs, the request body (JSON format) is formatted like so: {"user":{"email":"person1@example.com","password":"z5x6c7v8!@!"}} is there a way to pretty…
cm1745
  • 120
  • 2
  • 12
2
votes
0 answers

JSON response_body generated by rspec_api_documentation gem is empty (Rails)

I've successfully used rspec_api_documentation gem to generate docs for some other resources in an application. But when I do the same for a new resource, the JSON file's response_body is empty (though the rest of the JSON exists). And I'm unsure…
tim_xyz
  • 11,573
  • 17
  • 52
  • 97
2
votes
1 answer

Swagger Sails JS in production

I want to only have swagger in development environment but I want to disable this link or disable swagger when deploy on production. How can I do it?
haidn
  • 29
  • 5
1
vote
1 answer

Rspec api documentation + apitome request body in json format

I am using rspec api documentation, apitome and oauth2 protocol to build acceptance test to our api. Everything works great with one exception that the request body shown as below: What I noticed from the generated doc above: Content-Type:…
channa ly
  • 9,479
  • 14
  • 53
  • 86
1
vote
1 answer

Rspec API Documentation: Separating public and private APIs is not working

I am trying to separate my API docs to public and developers documentation, so that I can have separate docs which I can give to people other than me. For this I am using Rails and gem known as rspec_api_documentation, however I can't get it to…
Mauno Vähä
  • 9,688
  • 3
  • 33
  • 54
0
votes
1 answer

API Documentation using XML Comments in SwaggerHub

I am trying to update API documentation for REST APIs. Currently, I have a C# Asp.net Web API code and Swashbuckle.AspNetCore. I am editing and adding XML comments in C# using Visual Studio to update the API documentation. Is there a way I can do…
0
votes
1 answer

Composed query params for rspec api documentation

I' working on the tests and documentation of a searches endpoint that I implemented. I'm having trouble with properly adding the query params. Basically the request url should look like…
Ruby
  • 21
  • 3
0
votes
1 answer

Apitome sidebar disappears when included in a layout

I am using the rspec_api_documentation and apitome gems in a version 5.2 ruby on rails app. This produces excellent documentation, and has a sidebar (div#sidebar) to allow quick access to the correct part of the documentation. When I choose the…
Obromios
  • 15,408
  • 15
  • 72
  • 127
0
votes
1 answer

Template error using apitome gem

I am using rspec_api_documentation and apitome to generate api documentation. When I view the apitome output in the browser, there is a link entitled 'Simulated Response'. When I click on this, I get the following error: Missing template…
Obromios
  • 15,408
  • 15
  • 72
  • 127
1
2