56
questions
0
votes
2
answers
36
views
How to programatically set field values in Swagger UI
I'm using Rswag and Swagger UI, and I have two inputs on my form that I want to load dynamically from server side data, called date_range_start and date_range_end. The values I want to set are based ...
1
vote
1
answer
48
views
How to switch the order of two keys in OpenAPI YAML generated by Rswag?
In Swagger UI, there's a bug with allOf and nested associations which causes those parts of the schemas to not be included:
swagger example response not respecting nested allOf
https://github.com/...
2
votes
2
answers
55
views
RSwag not supporting apiKey pairs in requests
As you can see from the github issue, RSwag does not support multiple headers for api Key authentication.
This is my openapi/swagger yml, in following with Multiple API Key Setup in swagger docs:
...
0
votes
0
answers
86
views
RSwag `consumes` method does work in RSpec context
I am trying to test for wrong content type with RSwag and I put consumes method in a shared context
path '/api/profile' do
get 'profile' do
consumes 'application/json'
produces 'application/...
0
votes
1
answer
495
views
How to run paths in specific file or run only specific path to test swagger with rswag
I have a project in which many API calls are defined with rswag to generate the open API documentation.
In this project, I categorized my endpoint paths in separate ruby files.
My question is, When I ...
1
vote
1
answer
503
views
rswag to generate documentation with and without auth
I have an API that accepts a JWT bearer token. Expected results:
token description
status
message, if any
valid token
200
corrupt token
400
Your JWT appears to be invalid
no token
401
Did not ...
1
vote
1
answer
208
views
Anyway to get JSON schema to recognize null OR string type as valid without using type "null"
I understand that the typical response to this is to use
"type":"["string", "null"]
But the OpenAPI version we have is 3.0.x, not 3.1 so the type of null is not ...
0
votes
1
answer
288
views
test returning pdf with swagger in ruby on rails
I'm trying to test an endpoint that returns a pdf file.
My action looks like this:
def pdf
respond_to do |format|
format.pdf do
@pdf = ApplicationController.render pdf: ...
0
votes
1
answer
614
views
Multiple dock in one project with rswag rails
I try to create 2 docs for my api. I have 2 namespaces in routes and I need to create 2 docs for my first namespace and second namespace. In request test they are divided on 2 folders. How can I ...
2
votes
1
answer
824
views
Rswag not adding schema into response
I'm using the RSwag gem to create swagger OpenAPI specs: https://github.com/rswag/rswag
And I'm trying to get the schema for the response to appear in the Swagger API docs that are generated with the ...
0
votes
1
answer
541
views
Rails rswag - override default server to provide a different base URL
The API I am working with has a few endpoints to be routed through VeryGoodSecurity for PCI compliance.
It does seem as though OpenAPI V3 supports overriding servers as mentioned in this page
The ...
0
votes
1
answer
82
views
Rswag and FactoryBot - how to make them play nicely?
I am trying to write an Rswag test for some ActiveRecord validation against the account of a newly created record.
The issue I am having is that I can't work out how to create an Account using ...
0
votes
1
answer
260
views
Make rspec more DRY by accessing let variable in describe block
I'm trying to DRY up rspec tests that keeps on declaring let(:createBody) do...end. I thought to take out the let statement and just modify the variable on each block as needed. However the variable (...
1
vote
1
answer
453
views
How to test the callback for any actions in the controller using request.headers?
I have something like this controller:
class ApiApplicationController < ActionController::API
before_action :record_information_from_headers
private
def record_information_from_headers
...
1
vote
1
answer
1k
views
How to define a complex JSON response with Rswag using fast json api serializer
I'm getting rswag setup so I can easily generate documentation for my rails API. I'm already using gem 'jsonapi-serializer' to build the responses and it is working well.
However, I can't seem to ...