FAQ

  • GitHub GitHub Repo stars
  • Discord Discord Server
  • New! Try the OpenAPI DoctorThe OpenAPI Doctor

    operation-singular-tag


    Formats: Severity:

    Operation Tags are used to define operation categories or groups.

    Tools use tags differently when generating code, or documentation. Sometimes, multiple tags can interfere with how tools operate.

    To be honest, this rule is a bit obscure, generally it’s not recommended unless there is a specific use case for it.

    Why did this violation appear?

    Multiple tags have been used in an operation.

    What is this rule checking for?

    Every Operation is only allowed a single tag to be defined

    Bad example

    paths:
      /snakes/cakes:
        post:
          tags: 
            - snakes
            - cakes
            - planes
    

    Good Example

    paths:
      /snakes/cakes:
        post:
          tags: 
            - cakes
    

    How do I fix this violation?

    Reduce the number of tags an operation uses, down to one.

    Spectral Equivalent

    The rule is equivalent to operation-singular-tag