Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Example group metadata does not support symbol shorthand #674

Open
franzliedke opened this issue Sep 11, 2023 · 0 comments
Open

[BUG] Example group metadata does not support symbol shorthand #674

franzliedke opened this issue Sep 11, 2023 · 0 comments

Comments

@franzliedke
Copy link

Describe the bug

The custom example groups in RSwag (for example response) do not support symbol-style example metadata.

Steps to Test or Reproduce

Example spec:

response "201", "article created", :skip_bullet do
  # ...
end

This is perfectly valid in RSpec, but leads to the following error inside RSwag:

NoMethodError:
  undefined method `[]=' for :skip_bullet:Symbol

Expected behavior

The spec should be equivalent to the following, which works just fine:

response "201", "article created", skip_bullet: true do
  # ...
end

Additional context

This became a problem with the new MetadataStyle cop in rubocop-rspec, which has support for two enforced styles, hash or symbol.

Rubocop understands that response defines an example group with the following config:

RSpec:
  Language:
    ExampleGroups:
      Regular:
        - response

Dependency versions

The version of are you using for:

  • Rswag: 2.9.0
  • RSpec: 3.12
  • Rails: 7.0.8
  • Ruby: 3.2.2

Relates to which version of OAS (OpenAPI Specification)

Not related to OAS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants