You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Context
We use an RSpec plugin called RSwag that allows the creation of specs & swagger documentation from a single DSL. One of the features is that documented parameters can be populated in tests via let statements
eg.
describe'Blogs API - Individual Blog Endpoint'dopath'/blogs/{id}'doparameter(name: :id,in: :path,required: true,type: :string)let(:id){'foo'}# test code ensuesendend
The issue arises when providing an array as a query parameter
describe'Blogs API - Blog Collection Endpoint'dopath'/blogs'do# making a request to /blogs?id[]=foo&id[]=bar&id[]=bazparameter(name: :'id[]',in: :query,required: false,type: :array,items: {type: :string},collectionFormat: :multi,)let(:'id[]'){['foo','bar','baz']}# sets off the cop# test code ensuesendend
It's way too much of a corner case to modify the cop to ignore that specific pattern, but I think a generic option to ignore certain things by name or regex is appropriate.
The text was updated successfully, but these errors were encountered:
That's quite a strange name for a variable defined with let, but I guess it fits RSwag's style.
With an empty default Ignore: setting it is welcome, so is a pull request.
Feature Request
A configuration option to specify certain variables or patterns to ignore
Example
Context
We use an RSpec plugin called RSwag that allows the creation of specs & swagger documentation from a single DSL. One of the features is that documented parameters can be populated in tests via
let
statementseg.
The issue arises when providing an array as a query parameter
It's way too much of a corner case to modify the cop to ignore that specific pattern, but I think a generic option to ignore certain things by name or regex is appropriate.
The text was updated successfully, but these errors were encountered: