Skip to content

Unrecommend openapi-tags #1132

Closed
Closed
@philsturgeon

Description

@philsturgeon
Contributor

User story.
As a non-Stoplight user I do not understand the importance of tags, so it is a surprise when im told I absolutely must add them.

Is your feature request related to a problem?
Spectral users occasionally ask why Spectral is telling them to do things not in the OpenAPI spec. The answer is usually "this is a linter, not a validator" and that most of the rules are useful: avoiding bugs, stopping them getting hacked, etc.

One rule which doesn't fit the description is openapi-tags. It is useful for bigger APIs, but I'm working on a single endpoint OpenAPI description and adding tags to that is pretty redundant. It's there because Stoplight docs like tags, but for a single endpoint API I don't need my docs grouped like that anyhow.

Describe the solution you'd like

For v6.0 we should just make this one rule recommended: false.

Additional context

In the future I'd like to look into a spectral-stoplight-ruleset with all sorts of rules relevant to Stoplight but not particularly relevant to other tools. Food for thought whilst working on this so we know the direction at least.

Activity

added this to the v6.0 milestone on Apr 29, 2020
changed the title [-]Unrecommend openapi-tags / Stoplight Ruleset[/-] [+]Unrecommend openapi-tags[/+] on Apr 29, 2020
lornajane

lornajane commented on Apr 29, 2020

@lornajane
Contributor

I wonder if we could move to having a "minimally-valid" ruleset and then "probably-best-practice" ones? I agree with most of the current setup but always turn off tags since they don't make sense in our many small APIs. We use them in a few places, but not many.

philsturgeon

philsturgeon commented on Apr 29, 2020

@philsturgeon
ContributorAuthor

Although it's not explicitly stated anywhere, this is what recommended was meant to be. By default you only get rules with recommended: true, and to get all the rules you do this:

extends:
- ["spectral:oas", "all"]

Having all rules is basically the "strict mode" from speccy (remember --ruleset=strict?). If you enable this, prepare for a world of pain, but otherwise we tell you if things are structurally and semantically correct.

openapi-tags has felt out of place in this model, as its more of a strict thing than other rules so we're moving it over.

added a commit that references this issue on Aug 18, 2020
d5f3b5e
added a commit that references this issue on Aug 19, 2020
8632d82
added a commit that references this issue on Aug 20, 2020
1b17eeb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    breakingPull requests that introduce a breaking change

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      Participants

      @philsturgeon@lornajane

      Issue actions

        Unrecommend openapi-tags · Issue #1132 · stoplightio/spectral