rswag icon indicating copy to clipboard operation
rswag copied to clipboard

Adding operation tags to global tags

Open neongrau opened this issue 2 years ago • 1 comments

Using rswag to create OAS 3 specs.

When checking the result with spectral lint i get tons of warnings:

operation-tag-defined Operation tags must be defined in global tags

So as i understand the remedy would be to have a tags array in the root of the spec with the combination all tags used below paths.

Anyone got an idea how i could tap into this after running the rake task?

neongrau avatar Mar 20 '24 12:03 neongrau

I was searching for this.

I realized that the global tags can be added to the spec/swagger_helper.rb file.

Here is an example:

Rspec.configure do |config|
  config.openapi_specs = {
    "swagger.yaml": {
      tags: [
        {name: "My Global Tag"}
      ]
    }
  }
end

JAlfonsoRG avatar Jun 19 '24 18:06 JAlfonsoRG