FAQ

  • GitHub GitHub Repo stars
  • Discord Discord Server
  • Recommended

    operation-parameters


    Formats: Severity:

    Operation Parameters can be described through paths, headers cookies and queries.

    It’s important to ensure that none of these parameters are duplicates, which is easier that you may think, when an operation has multiple parameter definitions across different types.

    Why did this violation appear?

    There is a Parameter in the specification that has been duplicated or it’s using multiple input types

    What is this rule checking for?

    Every Operation is checked for the following

    • Parameters are unique in each operation
    • Correct use of forms and parameters.

    Bad examples

    Duplicate in: body definitions (OpenAPI 2 only):

    paths:
      /snakes/cakes:
        post:
          parameters:
            - in: body
              name: snakes
            - in: body
              name: cake

    Using both in: body and in: formData together (OpenAPI 2 only):

    paths:
      /snakes/cakes:
        post:
          parameters:
            - in: body
              name: snakes
            - in: formData
              name: cake

    Duplicate parameter names:

    paths:
      /users/{id}:
        get:
          parameters:
            - in: path
              name: id
            - in: query
              name: id

    How do I fix this violation?

    Check your parameters for duplicate names and mis-use of in: body and in: formData.

    Spectral Equivalent

    The rule is equivalent to operation-parameters