Skip to content
Last updated

path-http-verbs-order

Requires HTTP operations on each path item to appear in a consistent order.

OASCompatibility
2.0
3.0
3.1
3.2

API design principles

Keeping verbs in a predictable order (for example get before post) makes specs easier to scan and aligns with common style guides.

Configuration

OptionTypeDescription
severitystringPossible values: off, warn, error. Default off (in recommended and minimal configurations).
orderstring[]Ordered list of allowed HTTP method names. Operations on a path must follow this order. Default: get, head, post, put, patch, delete, options, query, trace.

An example configuration:

rules:
  path-http-verbs-order: error

Custom order:

rules:
  path-http-verbs-order:
    severity: error
    order:
      - get
      - post
      - put
      - patch
      - delete

Examples

With path-http-verbs-order: error, declaring post before get on the same path is reported because the default order expects get first.

Resources