documentationUrl: https://spec.openlint.org/
functions:
- digitalocean-ensureAllArraysHaveItemTypes
- digitalocean-ensureSchemaHasType
- trimble-check-content-type-for-206-get-response-code
- trimble-check-for-content-type-in-put-and-post-responses
- trimble-check-if-application-or-json-in-put-and-post-response
- trimble-check-if-response-body-json-in-get-response
- trimble-delete-must-not-return-body
functionsDir: ./functions
rules:
  openapi-operation-post-require-request-body:
    formats:
    - oas3
    description: POST HTTP methods can have a request body, providing a structured payload for configuring each API request.
    message: POST Requests MUST Have a Body
    severity: info
    given: $.paths.*.post
    then:
      field: requestBody
      function: truthy
    documentationUrl: https://apicommons.org/rules/#openapi-operation-post-require-request-body
  openapi-operation-post-require-request-body-oas2:
    formats:
    - oas2
    description: 'POST operations can accept a request payload; in Swagger 2.0 this is a `parameters` entry with `in: body`
      or `in: formData`, providing a structured payload for configuring each API request.'
    message: POST Requests MUST Have a Body Parameter
    severity: info
    given: $.paths.*.post
    then:
      field: parameters
      function: schema
      functionOptions:
        dialect: draft7
        schema:
          type: array
          contains:
            type: object
            required:
            - in
            properties:
              in:
                enum:
                - body
                - formData
    documentationUrl: https://apicommons.org/rules/#openapi-operation-post-require-request-body-oas2
  openapi-parameter-array-require-items:
    description: Parameters that are of an array type should always have the items defined, being explicit about what is continued
      as part of the array.
    message: Parameter Schema Array MUST Have Items
    severity: info
    given:
    - $.components.parameters.schema[?(@.type=='array')]
    - $.parameters.schema[?(@.type=='array')]
    then:
      field: items
      function: truthy
    documentationUrl: https://apicommons.org/rules/#openapi-parameter-array-require-items
  openapi-parameter-array-typed-items:
    description: Array parameters must have an items attribute with a type.
    message: '{{error}}'
    severity: info
    given: $..*.parameters[*]
    then:
      function: digitalocean-ensureAllArraysHaveItemTypes
    documentationUrl: https://apicommons.org/rules/#openapi-parameter-array-typed-items
  openapi-parameter-avoid-integer-id:
    description: Avoid exposing IDs as an integer, UUIDs or other interoperable strings are preferred.
    message: Avoid exposing IDs as an integer, UUIDs or other interoperable strings are preferred.
    severity: info
    given: $.paths..parameters[*].[?(@property === "name" && (@ === "id" || @ === "ID" || @ === "Id"))]^.schema
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          not:
            properties:
              type:
                const: integer
          properties:
            format:
              const: uuid
    documentationUrl: https://apicommons.org/rules/#openapi-parameter-avoid-integer-id
  openapi-parameter-integer-require-maximum:
    description: Parameters that are of the integer schema type must have their maximum value set, defining the shape of parameter
      data passed in with a request.
    message: Parameter Schema Type Integer Maximum
    severity: info
    given:
    - $.apis.*.properties.*
    - $.common.*
    then:
      field: maximum
      function: truthy
    documentationUrl: https://apicommons.org/rules/#openapi-parameter-integer-require-maximum
  openapi-parameter-integer-require-minimum:
    description: Parameters that are of the integer schema type must have their minimum value set, defining the shape of parameter
      data passed in with a request.
    message: Parameter Schema Type Integer Minimum
    severity: info
    given:
    - $.apis.*.properties.*
    - $.common.*
    then:
      field: minimum
      function: truthy
    documentationUrl: https://apicommons.org/rules/#openapi-parameter-integer-require-minimum
  openapi-parameter-require-in:
    severity: info
    description: Providing an in property for parameters gets explicit about whether a parameter is in the path, query, or
      a header, making it clear to consumers where they can configure their request.
    message: Parameters In Property MUST Be Set
    given:
    - $.components.parameters.*
    - $.parameters.*
    then:
      field: in
      function: truthy
    documentationUrl: https://apicommons.org/rules/#openapi-parameter-require-in
  openapi-parameter-require-required-flag:
    description: Providrequiredg an required property for parameters gets explicit about whether a parameter is required the
      path, query, or a header, making it clear to consumers where they can configure their request.
    message: Parameters Required Property MUST Be Set
    severity: info
    given:
    - $.components.parameters.*
    - $.parameters.*
    then:
      field: required
      function: truthy
    documentationUrl: https://apicommons.org/rules/#openapi-parameter-require-required-flag
  openapi-parameter-require-schema:
    formats:
    - oas3
    severity: info
    description: Parameters must always possess a schema to help define the format and shape of the parameter, setting expections
      with consumers about what should be passed in.
    message: Parameters MUST Have Schema
    given: $.components.parameters.*
    then:
      field: schema
      function: truthy
    documentationUrl: https://apicommons.org/rules/#openapi-parameter-require-schema
  openapi-parameter-require-schema-oas2:
    formats:
    - oas2
    severity: info
    description: 'In Swagger 2.0 only body parameters carry a `schema`; every reusable `in: body` parameter must possess a
      schema to define the shape of the payload, setting expectations with consumers about what should be passed in.'
    message: Body Parameters MUST Have Schema
    given: $.parameters[?(@.in=='body')]
    then:
      field: schema
      function: truthy
    documentationUrl: https://apicommons.org/rules/#openapi-parameter-require-schema-oas2
  openapi-parameter-schema-require-type:
    description: Parameters must always have their schema type defined, being precise about what type of data can be inputted
      and used to configure an API request.
    message: Parameter Schema Type
    severity: info
    given:
    - $.components.parameters.*.schema
    - $.parameters.*.schema
    then:
      field: type
      function: truthy
    documentationUrl: https://apicommons.org/rules/#openapi-parameter-schema-require-type
  openapi-parameter-schema-use-ref:
    description: Parameters must always use a schema reference that utilizes reusable schema that are defined as part of a
      centralized schema components library.
    message: Parameters MUST Use Schema Reference
    severity: info
    given:
    - $.components.parameters.*.schema
    - $.parameters.*.schema
    then:
      field: $ref
      function: falsy
    documentationUrl: https://apicommons.org/rules/#openapi-parameter-schema-use-ref
  openapi-parameter-string-require-max-length:
    description: Parameters that are of the string schema type must have their maximum value set, defining the shape of parameter
      data passed in with a request.
    message: Parameter Schema Type String MaxLength
    severity: info
    given:
    - $.apis.*.properties.*
    - $.common.*
    then:
      field: maxLength
      function: truthy
    documentationUrl: https://apicommons.org/rules/#openapi-parameter-string-require-max-length
  openapi-parameter-string-require-min-length:
    description: Parameters that are of the string schema type must have their minimum value set, defining the shape of parameter
      data passed in with a request.
    message: Parameter Schema Type String MinLength
    severity: info
    given:
    - $.apis.*.properties.*
    - $.common.*
    then:
      field: minLength
      function: truthy
    documentationUrl: https://apicommons.org/rules/#openapi-parameter-string-require-min-length
  openapi-parameter-string-require-pattern:
    description: Parameters that are of the string schema type must have a pattern set, using a regex to define the shape
      of parameter data passed in with a request.
    message: Parameter Schema Type String Pattern
    severity: info
    given:
    - $.apis.*.properties.*
    - $.common.*
    then:
      field: pattern
      function: truthy
    documentationUrl: https://apicommons.org/rules/#openapi-parameter-string-require-pattern
  openapi-path-delete-no-response-body:
    description: Check if the delete response does not have any body.
    message: '{{error}}'
    severity: info
    given: $.paths.*
    then:
      function: trimble-delete-must-not-return-body
    documentationUrl: https://apicommons.org/rules/#openapi-path-delete-no-response-body
  openapi-path-get-response-support-json:
    description: All APIs returning structured data SHOULD support JSON as the default format.
    message: '{{error}}'
    severity: info
    given: $.paths.*
    then:
      function: trimble-check-if-response-body-json-in-get-response
    documentationUrl: https://apicommons.org/rules/#openapi-path-get-response-support-json
  openapi-path-write-response-support-json:
    description: All APIs returning structured data SHOULD support JSON as the default format.
    message: '{{error}}'
    severity: info
    given: $.paths.*
    then:
      function: trimble-check-if-application-or-json-in-put-and-post-response
    documentationUrl: https://apicommons.org/rules/#openapi-path-write-response-support-json
  openapi-request-patch-media-type-not-plain-json:
    description: 'The PATCH specification explicits that the request body contains a "patch document" describing the changes
      to be applied to the target resource. To avoid confusion, [this errata](https://www.rfc-editor.org/errata/eid3169) explains
      that `application/json` is not an appropriate media-type for `PATCH`. A correct example of PATCH using eg. `application/json-patch+json`
      media-type defined in RFC6902. ``` paths: /books/{book_id}: patch: requestBody: content: application/json-patch+json:
      schema: type: object example: [{ "op": "add", "path": "/baz", "value": "qux" }] ```.'
    message: application/json is not an appropriate media-type for PATCH. {{path}}
    severity: info
    given: $.[patch][requestBody][content]
    then:
      field: application/json
      function: falsy
    formats:
    - oas3
    documentationUrl: https://apicommons.org/rules/#openapi-request-patch-media-type-not-plain-json
  openapi-request-post-collection-require-paging-object:
    formats:
    - oas3
    description: POST collection endpoints MUST have a request body schema that includes paging parameters.
    message: POST collection endpoints MUST have a request body schema that includes paging parameters.
    severity: info
    given: $.paths[?(!@property.match(/.*\/\{[^}]+\}$/))].post.requestBody.content.application/json.schema.properties.paging
    then:
      field: type
      function: pattern
      functionOptions:
        match: object
    documentationUrl: https://apicommons.org/rules/#openapi-request-post-collection-require-paging-object
  openapi-request-post-collection-require-paging-object-oas2:
    formats:
    - oas2
    description: POST collection endpoints MUST have a body-parameter schema that includes paging parameters.
    message: POST collection endpoints MUST have a body-parameter schema that includes paging parameters.
    severity: info
    given: $.paths[?(!@property.match(/.*\/\{[^}]+\}$/))].post.parameters[?(@.in=='body')].schema.properties.paging
    then:
      field: type
      function: pattern
      functionOptions:
        match: object
    documentationUrl: https://apicommons.org/rules/#openapi-request-post-collection-require-paging-object-oas2
  openapi-response-206-require-content-range:
    description: Check if the get response code 206 has content-type and content-range.
    message: '{{error}}'
    severity: info
    given: $.paths.*
    then:
      function: trimble-check-content-type-for-206-get-response-code
    documentationUrl: https://apicommons.org/rules/#openapi-response-206-require-content-range
  openapi-response-body-must-be-object:
    formats:
    - oas3
    description: Response bodies must be an object type.
    message: Response bodies must be an object type.
    severity: info
    given: $.paths[*][*].responses[*].content.application/json.schema.type
    then:
      function: pattern
      functionOptions:
        match: object
    documentationUrl: https://apicommons.org/rules/#openapi-response-body-must-be-object
  openapi-response-body-must-be-object-oas2:
    formats:
    - oas2
    description: Response bodies must be an object type.
    message: Response bodies must be an object type.
    severity: info
    given: $.paths[*][*].responses[*].schema.type
    then:
      function: pattern
      functionOptions:
        match: object
    documentationUrl: https://apicommons.org/rules/#openapi-response-body-must-be-object-oas2
  openapi-response-collection-require-results-array:
    formats:
    - oas3
    description: Response bodies must have a root element called results and is an array of objects.
    message: Response bodies must have a root element called results and is an array of objects.
    severity: info
    given: $.paths[?(!@property.match(/.*\/\{[^}]+\}$/))].get.responses['200'].content.application/json.schema.properties.results
    then:
    - field: type
      function: pattern
      functionOptions:
        match: array
    - field: items.type
      function: pattern
      functionOptions:
        match: object
    documentationUrl: https://apicommons.org/rules/#openapi-response-collection-require-results-array
  openapi-response-collection-require-results-array-oas2:
    formats:
    - oas2
    description: Response bodies must have a root element called results and is an array of objects.
    message: Response bodies must have a root element called results and is an array of objects.
    severity: info
    given: $.paths[?(!@property.match(/.*\/\{[^}]+\}$/))].get.responses['200'].schema.properties.results
    then:
    - field: type
      function: pattern
      functionOptions:
        match: array
    - field: items.type
      function: pattern
      functionOptions:
        match: object
    documentationUrl: https://apicommons.org/rules/#openapi-response-collection-require-results-array-oas2
  openapi-response-success-use-hal-json:
    description: All 2xx success responses MUST use the `application/hal+json` media type.
    message: 'Success response documents MUST use the application/hal+json media type: {{error}}'
    severity: info
    given: $.paths..responses[?( @property >= 200 && @property < 300 && @property != 204)].content[*]~
    then:
      function: enumeration
      functionOptions:
        values:
        - application/hal+json
    formats:
    - oas3
    documentationUrl: https://apicommons.org/rules/#openapi-response-success-use-hal-json
  openapi-response-use-json-api:
    description: All responses MUST use the JSON:API `application/vnd.api+json` media type.
    message: 'Response documents MUST use the application/vnd.api+json (JSON:API) media type: {{error}}'
    severity: info
    given: $.paths..responses[?( @property >= 200 && @property < 600 && @property != 204)].content[*]~
    then:
      function: enumeration
      functionOptions:
        values:
        - application/vnd.api+json
    formats:
    - oas3
    documentationUrl: https://apicommons.org/rules/#openapi-response-use-json-api
  openapi-response-use-standard-mime-types:
    formats:
    - oas3
    description: MIME types MUST be standard (application/json, application/problem+json, application/problem+xml) or use
      custom format application/vnd.*.
    message: MIME types MUST be standard (application/json, application/problem+json, application/problem+xml) or use custom
      format application/vnd.*.
    severity: info
    given: $.paths[*][*].responses[*].content.*~
    then:
      function: pattern
      functionOptions:
        match: ^application/(json|problem\+json|problem\+xml|vnd\..*)$
    documentationUrl: https://apicommons.org/rules/#openapi-response-use-standard-mime-types
  openapi-response-use-standard-mime-types-oas2:
    formats:
    - oas2
    description: Produced MIME types MUST be standard (application/json, application/problem+json, application/problem+xml)
      or use custom format application/vnd.*.
    message: MIME types MUST be standard (application/json, application/problem+json, application/problem+xml) or use custom
      format application/vnd.*.
    severity: info
    given: $.paths[*][*].produces[*]
    then:
      function: pattern
      functionOptions:
        match: ^application/(json|problem\+json|problem\+xml|vnd\..*)$
    documentationUrl: https://apicommons.org/rules/#openapi-response-use-standard-mime-types-oas2
  openapi-response-write-require-content-type:
    description: All API responses MUST include the Content-Type header in all responses.
    message: '{{error}}'
    severity: info
    given:
    - $.paths[*].post.responses
    - $.paths[*].put.responses
    then:
      function: trimble-check-for-content-type-in-put-and-post-responses
    documentationUrl: https://apicommons.org/rules/#openapi-response-write-require-content-type
  openapi-schema-array-property-require-items:
    description: Schema properties that are of the type array must have an items property defined.
    message: Schema Array Properties MUST Have Items
    severity: info
    given:
    - $.components.schemas.*.properties[?(@.type=="array")]
    - $.definitions.*.properties[?(@.type=="array")]
    then:
      field: items
      function: truthy
    documentationUrl: https://apicommons.org/rules/#openapi-schema-array-property-require-items
  openapi-schema-array-property-require-max-items:
    description: Schema properties that are of the type array should have a max items property defined.
    message: Schema Array Properties MUST Have Max Items
    severity: info
    given:
    - $.components.schemas.*.properties[?(@.type=="array")]
    - $.definitions.*.properties[?(@.type=="array")]
    then:
    - field: maxItems
      function: truthy
    documentationUrl: https://apicommons.org/rules/#openapi-schema-array-property-require-max-items
  openapi-schema-array-property-require-min-items:
    description: Schema properties that are of the type array should have a min items property defined.
    message: Schema Array Properties MUST Have Min Items
    severity: info
    given:
    - $.components.schemas.*.properties[?(@.type=="array")]
    - $.definitions.*.properties[?(@.type=="array")]
    then:
    - field: minItems
      function: truthy
    documentationUrl: https://apicommons.org/rules/#openapi-schema-array-property-require-min-items
  openapi-schema-array-property-typed-items:
    description: Array properties must have an items attribute with a type.
    message: '{{error}}'
    severity: info
    given: $..*.properties[*]
    then:
      function: digitalocean-ensureAllArraysHaveItemTypes
    documentationUrl: https://apicommons.org/rules/#openapi-schema-array-property-typed-items
  openapi-schema-array-require-min-max-items:
    description: 'Array size should be limited to mitigate resource exhaustion attacks. This can be done using `maxItems`
      and `minItems`, like in the example below. ``` Limited: type: array maxItems: 10 items: type: string format: date ```
      You should ensure that the schema referenced in `items` is constrained too. If you delegate input validation to a library
      or framework, be sure to test it thoroughly and ensure that it verifies `maxItems`.'
    message: Schema of type array must specify maxItems and minItems. {{path}} {{error}}
    severity: info
    given:
    - $.[?(@.type=="array")]
    then:
    - field: maxItems
      function: defined
    - field: minItems
      function: defined
    formats:
    - oas3
    documentationUrl: https://apicommons.org/rules/#openapi-schema-array-require-min-max-items
  openapi-schema-created-datetime-must-be-date-time:
    description: createdDateTime MUST use a data type of 'string' with the format 'date-time'.
    message: createdDateTime MUST use a data type of 'string' with the format 'date-time'.
    severity: info
    given: $..properties.createdDateTime
    then:
    - field: type
      function: pattern
      functionOptions:
        match: ^string$
    - field: format
      function: truthy
    - field: format
      function: pattern
      functionOptions:
        match: ^date-time$
    formats:
    - oas3
    documentationUrl: https://apicommons.org/rules/#openapi-schema-created-datetime-must-be-date-time
  openapi-schema-createdby-property-must-be-string:
    description: createdBy MUST use a data type of 'string'.
    message: createdBy MUST use a data type of 'string'.
    severity: info
    given: $..[?(@property === "createdBy")].type
    then:
      function: pattern
      functionOptions:
        match: ^string$
    formats:
    - oas3
    documentationUrl: https://apicommons.org/rules/#openapi-schema-createdby-property-must-be-string
  openapi-schema-date-time-property-require-format:
    description: Date/time string properties (createdAt, updated_at, *_date, timestamp, …) should declare a format such as
      date-time (RFC 3339) so the value is unambiguous and machine-validatable.
    message: Date/time string property should declare a format (e.g. date-time).
    given: $..properties[?( @property.match(/(_at$|_date$|_time$|At$|Date$|Time$|timestamp)/i) && @.type == 'string' )]
    severity: info
    then:
      field: format
      function: truthy
    documentationUrl: https://apicommons.org/rules/#openapi-schema-date-time-property-require-format
  openapi-schema-deletedby-property-must-be-string:
    description: deletedBy MUST use a data type of 'string'.
    message: deletedBy MUST use a data type of 'string'.
    severity: info
    given: $..[?(@property === "deletedBy")].type
    then:
      function: pattern
      functionOptions:
        match: ^string$
    formats:
    - oas3
    documentationUrl: https://apicommons.org/rules/#openapi-schema-deletedby-property-must-be-string
  openapi-schema-description-property-must-be-string:
    description: description MUST use a data type of 'string'.
    message: description MUST use a data type of 'string'.
    severity: info
    given: $..[?(@property === "description")].type
    then:
      function: pattern
      functionOptions:
        match: ^string$
    formats:
    - oas3
    documentationUrl: https://apicommons.org/rules/#openapi-schema-description-property-must-be-string
  openapi-schema-enum-not-empty:
    description: An enum should declare at least one value — an empty enum permits nothing and is almost always a mistake.
    message: enum should not be empty.
    given: $..enum
    severity: info
    then:
      function: schema
      functionOptions:
        schema:
          type: array
          minItems: 1
    documentationUrl: https://apicommons.org/rules/#openapi-schema-enum-not-empty
  openapi-schema-fingerprint-property-must-be-string:
    description: Fingerprint values MUST use a data type of `string`.
    message: Fingerprint values MUST use a data type of `string`.
    severity: info
    given: $..[?(@property === "fingerprint")].type
    then:
      function: pattern
      functionOptions:
        match: ^string$
    formats:
    - oas3
    documentationUrl: https://apicommons.org/rules/#openapi-schema-fingerprint-property-must-be-string
  openapi-schema-id-property-must-be-string:
    description: id SHOULD use a data type of 'string'.
    message: id SHOULD use a data type of 'string'.
    severity: info
    given: $..[?(@property === "id")].type
    then:
      function: pattern
      functionOptions:
        match: ^string$
    formats:
    - oas3
    documentationUrl: https://apicommons.org/rules/#openapi-schema-id-property-must-be-string
  openapi-schema-integer-format-allowed-values:
    description: To improve interoperability, integer and number formats are constrained to a shared subset. See recommendation
      RAC_REST_FORMAT_004.
    message: Type format is "{{value}}", expected one of [int32, int64]. {{path}}
    severity: info
    given: '$.[?(@.type=="integer")]

      '
    then:
      field: format
      function: enumeration
      functionOptions:
        values:
        - int32
        - int64
    formats:
    - oas3
    documentationUrl: https://apicommons.org/rules/#openapi-schema-integer-format-allowed-values
  openapi-schema-integer-require-format:
    description: Schema of type number or integer must specify a format to express the associated datatype, eg. `int32`, `int64`,
      ... You can express similar requirements using the `minimum` and `maximum` properties. See recommendation RAC_REST_FORMAT_004.
    message: Schema of type number or integer must specify a format. {{path}}
    severity: info
    given: '$.[?(@.type=="integer")]

      '
    then:
      field: format
      function: truthy
    formats:
    - oas3
    documentationUrl: https://apicommons.org/rules/#openapi-schema-integer-require-format
  openapi-schema-modified-datetime-must-be-date-time:
    description: modifiedDateTime MUST use a data type of 'string' with the format 'date-time'.
    message: modifiedDateTime MUST use a data type of 'string' with the format 'date-time'.
    severity: info
    given: $..properties.modifiedDateTime
    then:
    - field: type
      function: pattern
      functionOptions:
        match: ^string$
    - field: format
      function: truthy
    - field: format
      function: pattern
      functionOptions:
        match: ^date-time$
    formats:
    - oas3
    documentationUrl: https://apicommons.org/rules/#openapi-schema-modified-datetime-must-be-date-time
  openapi-schema-modifiedby-property-must-be-string:
    description: modifiedBy MUST use a data type of 'string'.
    message: modifiedBy MUST use a data type of 'string'.
    severity: info
    given: $..[?(@property === "modifiedBy")].type
    then:
      function: pattern
      functionOptions:
        match: ^string$
    formats:
    - oas3
    documentationUrl: https://apicommons.org/rules/#openapi-schema-modifiedby-property-must-be-string
  openapi-schema-monetary-property-avoid-float:
    description: Monetary properties (amount, price, cost, fee, balance, …) should avoid floating-point numbers, which lose
      precision — use an integer of minor units or a decimal string instead.
    message: Monetary property should not be a floating-point number.
    given: $..properties[?( @property.match(/(amount|price|cost|total|fee|balance|subtotal)/i) )]
    severity: info
    then:
      field: type
      function: pattern
      functionOptions:
        notMatch: ^number$
    documentationUrl: https://apicommons.org/rules/#openapi-schema-monetary-property-avoid-float
  openapi-schema-name-property-must-be-string:
    description: name MUST use a data type of 'string'.
    message: name MUST use a data type of 'string'.
    severity: info
    given: $..[?(@property === "name")].type
    then:
      function: pattern
      functionOptions:
        match: ^string$
    formats:
    - oas3
    documentationUrl: https://apicommons.org/rules/#openapi-schema-name-property-must-be-string
  openapi-schema-number-format-allowed-values:
    description: To improve interoperability, integer and number formats are constrained to a shared subset. See recommendation
      RAC_REST_FORMAT_004.
    message: Type format is "{{value}}", expected one of [decimal32, decimal64, decimal128, float, double]. {{path}}
    severity: info
    given: '$.[?(@.type=="number")]

      '
    then:
      field: format
      function: enumeration
      functionOptions:
        values:
        - decimal32
        - decimal64
        - float
        - double
        - decimal128
    formats:
    - oas3
    documentationUrl: https://apicommons.org/rules/#openapi-schema-number-format-allowed-values
  openapi-schema-number-property-require-maximum:
    description: Schema properties that are of the type number should have a maximum property defined.
    message: Schema Number Properties MUST Have Maximum
    severity: info
    given:
    - $.components.schemas.*.properties[?(@.type=="number")]
    - $.definitions.*.properties[?(@.type=="number")]
    then:
    - field: maximum
      function: defined
    documentationUrl: https://apicommons.org/rules/#openapi-schema-number-property-require-maximum
  openapi-schema-number-property-require-minimum:
    description: Schema properties that are of the type number should have a minimum property defined.
    message: Schema Number Properties MUST Have Minimum
    severity: info
    given:
    - $.components.schemas.*.properties[?(@.type=="number")]
    - $.definitions.*.properties[?(@.type=="number")]
    then:
    - field: minimum
      function: defined
    documentationUrl: https://apicommons.org/rules/#openapi-schema-number-property-require-minimum
  openapi-schema-number-require-format:
    description: Schema of type number or integer must specify a format to express the associated datatype, eg. `int32`, `int64`,
      ... You can express similar requirements using the `minimum` and `maximum` properties. See recommendation RAC_REST_FORMAT_004.
    message: Schema of type number or integer must specify a format. {{path}}
    severity: info
    given: $.[?(@.type=="number")]
    then:
      field: format
      function: truthy
    formats:
    - oas3
    documentationUrl: https://apicommons.org/rules/#openapi-schema-number-require-format
  openapi-schema-number-require-min-max:
    description: Numeric values should be limited in size to mitigate resource exhaustion using `maximum` and `minimum`. If
      you delegate input validation to a library or framework, be sure to test it thoroughly.
    message: Schema of type number or integer must specify a maximum and a minimum. {{path}} {{error}}
    severity: info
    given:
    - $.[?(@.type=="number")]
    - $.[?(@.type=="integer")]
    then:
    - field: maximum
      function: defined
    - field: minimum
      function: defined
    formats:
    - oas3
    documentationUrl: https://apicommons.org/rules/#openapi-schema-number-require-min-max
  openapi-schema-object-constrain-additional-property:
    description: 'By default, jsonschema allows additionalProperties. This means that schema validators can be bypassed using
      further, unspecified fields. While forbidding additionalProperties can create rigidity and hinder the evolution of an
      API - eg making it hard to accept new parameters or fields - it is possible that this flexibility can be used to bypass
      the schema validator and force the application to process unwanted information. Disable `additionalProperties` with
      `false` ``` Person: type: object additionalProperties: false properties: given_name: type: string pattern: [a-zA-Z ]{24}
      ``` Or constraint them using `maxProperties` ``` Person: type: object additionalProperties: type: string pattern: /+39[0-9]{,14}/
      maxProperties: 3 properties: given_name: type: string pattern: [a-zA-Z ]{24} ``` - no additionalProperties - constrained
      additionalProperties.'
    message: 'Objects should not allow additionalProperties. Disable them with `additionalProperties: false` or constraint
      them.'
    severity: info
    given:
    - $.[?(@.type=="object" && @.additionalProperties &&  @.additionalProperties!=true &&  @.additionalProperties!=false )]
    then:
    - field: maxProperties
      function: defined
    formats:
    - oas3
    documentationUrl: https://apicommons.org/rules/#openapi-schema-object-constrain-additional-property
  openapi-schema-object-disallow-additional-property:
    description: 'By default, jsonschema allows additionalProperties. This means that schema validators can be bypassed using
      further, unspecified fields. While forbidding additionalProperties can create rigidity and hinder the evolution of an
      API - eg making it hard to accept new parameters or fields - it is possible that this flexibility can be used to bypass
      the schema validator and force the application to process unwanted information. Disable `additionalProperties` with
      `false` ``` Person: type: object additionalProperties: false properties: given_name: type: string pattern: [a-zA-Z ]{24}
      ``` Or constraint them using `maxProperties` ``` Person: type: object additionalProperties: type: string pattern: /+39[0-9]{,14}/
      maxProperties: 3 properties: given_name: type: string pattern: [a-zA-Z ]{24} ``` - no additionalProperties - constrained
      additionalProperties.'
    message: 'Objects should not allow additionalProperties. Disable them with `additionalProperties: false` or constraint
      them.'
    severity: info
    given:
    - $.[?(@.type=="object" && @.additionalProperties==true)]
    then:
    - field: additionalProperties
      function: falsy
    formats:
    - oas3
    documentationUrl: https://apicommons.org/rules/#openapi-schema-object-disallow-additional-property
  openapi-schema-object-set-additional-property:
    description: 'By default, jsonschema allows additionalProperties. This means that schema validators can be bypassed using
      further, unspecified fields. While forbidding additionalProperties can create rigidity and hinder the evolution of an
      API - eg making it hard to accept new parameters or fields - it is possible that this flexibility can be used to bypass
      the schema validator and force the application to process unwanted information. Disable `additionalProperties` with
      `false` ``` Person: type: object additionalProperties: false properties: given_name: type: string pattern: [a-zA-Z ]{24}
      ``` Or constraint them using `maxProperties` ``` Person: type: object additionalProperties: type: string pattern: /+39[0-9]{,14}/
      maxProperties: 3 properties: given_name: type: string pattern: [a-zA-Z ]{24} ``` - no additionalProperties - constrained
      additionalProperties. @.additionalProperties)]`).'
    message: 'Objects should not allow additionalProperties. Disable them with `additionalProperties: false` or constraint
      them.'
    severity: info
    given:
    - $.[?(@.type=="object" && ! @.additionalProperties)]
    then:
    - field: additionalProperties
      function: defined
    formats:
    - oas3
    documentationUrl: https://apicommons.org/rules/#openapi-schema-object-set-additional-property
  openapi-schema-orgid-property-must-be-string:
    description: orgId MUST use a data type of 'string'.
    message: orgId MUST use a data type of 'string'.
    severity: info
    given: $..[?(@property === "orgId")].type
    then:
      function: pattern
      functionOptions:
        match: ^string$
    formats:
    - oas3
    documentationUrl: https://apicommons.org/rules/#openapi-schema-orgid-property-must-be-string
  openapi-schema-property-require-description:
    description: Schema properties should have descriptions that provide a narrative of the property contains, and how it
      can be used.
    message: Schema Properties MUST Have Description
    severity: info
    given:
    - $.components.schemas.*.properties[?(@.type == 'string')]
    - $.definitions.*.properties[?(@.type == 'string')]
    then:
      field: description
      function: truthy
    documentationUrl: https://apicommons.org/rules/#openapi-schema-property-require-description
  openapi-schema-property-require-type:
    description: Schema properties must have a type defined.
    message: '{{error}}'
    severity: info
    given: $..properties.*
    then:
      function: digitalocean-ensureSchemaHasType
    documentationUrl: https://apicommons.org/rules/#openapi-schema-property-require-type
  openapi-schema-ref-property-must-be-string:
    description: ref MUST use a data type of 'string'.
    message: ref MUST use a data type of 'string'.
    severity: info
    given: $..[?(@property === "ref")].type
    then:
      function: pattern
      functionOptions:
        match: ^string$
    formats:
    - oas3
    documentationUrl: https://apicommons.org/rules/#openapi-schema-ref-property-must-be-string
  openapi-schema-ref-property-require-format:
    description: Property with the name 'ref' MUST use a format 'sps-ref'.
    message: Property with the name 'ref' MUST use a format 'sps-ref'.
    severity: info
    given: $..properties..[?((@property=== "ref" || @property === "Ref") && @.$ref == null && @.allOf == null && @.oneOf ==
      null && @.type != null)]
    then:
    - field: format
      function: truthy
    - field: format
      function: pattern
      functionOptions:
        match: ^sps-ref$
    formats:
    - oas3
    documentationUrl: https://apicommons.org/rules/#openapi-schema-ref-property-require-format
  openapi-schema-ref-property-standard:
    description: Properties following 'sps-ref' format MUST use the standardized schema - maxLength (255), minLength(7), pattern
      (includes 'sps'), type (string).
    message: '{{property}} is not provided or not following required schema values.'
    severity: info
    given: $..[?(@property=== "format" && @ == "sps-ref")]^
    then:
    - function: schema
      functionOptions:
        schema:
          type: object
          required:
          - maxLength
          - minLength
          - type
          - pattern
          properties:
            maxLength:
              type: integer
              minimum: 255
              maximum: 255
            minLength:
              type: integer
              minimum: 7
              maximum: 7
            type:
              type: string
            pattern:
              type: string
    - field: pattern
      function: pattern
      functionOptions:
        match: sps
    - field: type
      function: pattern
      functionOptions:
        match: ^string$
    formats:
    - oas3
    documentationUrl: https://apicommons.org/rules/#openapi-schema-ref-property-standard
  openapi-schema-requestid-property-must-be-string:
    description: requestId MUST use a data type of 'string'.
    message: requestId MUST use a data type of 'string'.
    severity: info
    given: $..[?(@property === "requestId")].type
    then:
      function: pattern
      functionOptions:
        match: ^string$
    formats:
    - oas3
    documentationUrl: https://apicommons.org/rules/#openapi-schema-requestid-property-must-be-string
  openapi-schema-require-description:
    description: Schema should have descriptions that provide a narrative of what a schema object is for, and how it can be
      used, leaving examples to demonstrate what can actually be expected.
    message: Schema MUST Have a Description.
    severity: info
    given:
    - $.components.schemas.*
    - $.definitions.*
    then:
      field: description
      function: truthy
    documentationUrl: https://apicommons.org/rules/#openapi-schema-require-description
  openapi-schema-require-name:
    description: Schema names, keeping the naming of them consistent across APIs, standardizing how consumers can use in their
      applications.
    message: Schema Names MUST Exist
    severity: info
    given:
    - $.components.schemas
    - $.definitions
    then:
      field: '@key'
      function: truthy
    documentationUrl: https://apicommons.org/rules/#openapi-schema-require-name
  openapi-schema-require-type:
    description: Schema should have a type defined, being explicit about type of data a schema describes and can be used to
      validate, helping standardize the type of data being made available.
    message: Schema MUST Have Type Property
    severity: info
    given:
    - $.components.schemas.*
    - $.definitions.*
    then:
      field: type
      function: truthy
    documentationUrl: https://apicommons.org/rules/#openapi-schema-require-type
  openapi-schema-string-property-require-max-length:
    description: Schema properties that are of the string type have the max length applied defining the shape of the property.
    message: Schema String Properties MUST Have Maximum Length
    severity: info
    given:
    - $.components.schemas.*.properties[?(@.type == 'string')]
    - $.definitions.*.properties[?(@.type == 'string')]
    then:
      field: maxLength
      function: truthy
    documentationUrl: https://apicommons.org/rules/#openapi-schema-string-property-require-max-length
  openapi-schema-string-property-require-min-length:
    description: Schema properties that are of the string type have the min length applied defining the shape of the property.
    message: Schema String Properties MUST Have Minimum Length
    severity: info
    given:
    - $.components.schemas.*.properties[?(@.type == 'string')]
    - $.definitions.*.properties[?(@.type == 'string')]
    then:
      field: minLength
      function: truthy
    documentationUrl: https://apicommons.org/rules/#openapi-schema-string-property-require-min-length
  openapi-schema-string-require-max-length:
    description: 'String length should be limited to avoid an attacker to send very long strings to your service. You can
      do this in different ways: - specify a `maxLength` - constraint the possible values with an `enum` - use a constrained
      `format` like `date` or `date-time`. A constrained string using the `date` format. ``` ConstrainedString: type: string
      format: date ``` Another constrained string using `maxLength`. You can always add further constraints using a `pattern`
      or a `format`. ``` ZipCode: type: string maxLength: 5 pattern: ''[0-9]{5}'' ``` For further security, you can always
      limit string length even in conjunction with `format` and `pattern`.'
    message: Strings (non enum) must specify a maximum length. {{path}} {{error}}
    severity: info
    given:
    - $.[?(@.type=="string" && !@.enum && @.format!="date" && @.format !="date-time" )]
    then:
    - field: maxLength
      function: defined
    formats:
    - oas3
    documentationUrl: https://apicommons.org/rules/#openapi-schema-string-require-max-length
  openapi-schema-string-require-pattern-or-format:
    description: 'String length should be limited to avoid an attacker to send very long strings to your service. You can
      do this in different ways: - specify a `maxLength` - constraint the possible values with an `enum` - use a constrained
      `format` like `date` or `date-time`. A constrained string using the `date` format. ``` ConstrainedString: type: string
      format: date ``` Another constrained string using `maxLength`. You can always add further constraints using a `pattern`
      or a `format`. ``` ZipCode: type: string maxLength: 5 pattern: ''[0-9]{5}'' ``` For further security, you can always
      limit string length even in conjunction with `format` and `pattern`.'
    message: Strings (non enum) must specify a pattern or a format. {{path}}
    severity: info
    given:
    - $.[?(@.type=="string" && !@.enum && @.format!="date" && @.format !="date-time" )]
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          anyOf:
          - required:
            - pattern
          - required:
            - format
          additionalProperties: true
    formats:
    - oas3
    documentationUrl: https://apicommons.org/rules/#openapi-schema-string-require-pattern-or-format
  apis-json-api-entry-require-tag:
    description: Each API defined in an APIs.json artifact includes a property for adding one or more tags. These tags provide
      additional context about the resources or capabilities offered by the API, highlighting its business value and the domain
      in which it is applied.
    message: API MUST Have a Tags Object
    severity: info
    given: $.apis.*
    then:
      field: tags
      function: truthy
    documentationUrl: https://apicommons.org/rules/#apis-json-api-entry-require-tag
  asyncapi-component-asyncapi-message-require-contenttype:
    description: Messages should declare a contentType (e.g. application/json).
    message: Message should declare a contentType.
    given: $.components.messages[*]
    severity: info
    then:
      field: contentType
      function: truthy
    documentationUrl: https://apicommons.org/rules/#asyncapi-component-asyncapi-message-require-contenttype
  asyncapi-component-asyncapi-message-require-payload:
    description: Messages should define a payload schema.
    message: Message should define a payload.
    given: $.components.messages[*]
    severity: info
    then:
      field: payload
      function: truthy
    documentationUrl: https://apicommons.org/rules/#asyncapi-component-asyncapi-message-require-payload
  json-schema-document-require-description:
    description: The `description` property should be present.
    message: description should be present
    severity: info
    given: $
    then:
      field: description
      function: truthy
    documentationUrl: https://apicommons.org/rules/#json-schema-document-require-description
  json-schema-document-require-id:
    description: The `$id` property should be present.
    message: $id should be present
    severity: info
    given: $
    then:
      field: $id
      function: truthy
    documentationUrl: https://apicommons.org/rules/#json-schema-document-require-id
  json-schema-document-require-property:
    description: The `properties` property should be present.
    message: properties should be present
    severity: info
    given: $
    then:
      field: properties
      function: truthy
    documentationUrl: https://apicommons.org/rules/#json-schema-document-require-property
  json-schema-document-require-required-list:
    description: The `required` property should be present.
    message: required should be present
    severity: info
    given: $
    then:
      field: required
      function: truthy
    documentationUrl: https://apicommons.org/rules/#json-schema-document-require-required-list
  json-schema-document-require-title:
    description: The `title` property should be present.
    message: title should be present
    severity: info
    given: $
    then:
      field: title
      function: truthy
    documentationUrl: https://apicommons.org/rules/#json-schema-document-require-title
  json-schema-document-require-type:
    description: The `type` property should be present.
    message: type should be present
    severity: info
    given: $
    then:
      field: type
      function: truthy
    documentationUrl: https://apicommons.org/rules/#json-schema-document-require-type
  json-schema-schema-property-require-description:
    description: The `description` property of each property should be present.
    message: description should be present
    severity: info
    given: $.properties[*]
    then:
      field: description
      function: truthy
    documentationUrl: https://apicommons.org/rules/#json-schema-schema-property-require-description
  json-schema-schema-property-require-type:
    description: The `type` property of each property should be present.
    message: type should be present
    severity: info
    given: $.properties[*]
    then:
      field: type
      function: truthy
    documentationUrl: https://apicommons.org/rules/#json-schema-schema-property-require-type
  json-schema-schema-require:
    description: The `$schema` property should be present.
    message: $schema should be present
    severity: info
    given: $
    then:
      field: $schema
      function: truthy
    documentationUrl: https://apicommons.org/rules/#json-schema-schema-require
  json-structure-document-require-id:
    description: The `$id` property should be present.
    message: $id should be present
    severity: info
    given: $
    then:
      field: $id
      function: truthy
    documentationUrl: https://apicommons.org/rules/#json-structure-document-require-id
  json-structure-document-require-name:
    description: The `name` property should be present.
    message: name should be present
    severity: info
    given: $
    then:
      field: name
      function: truthy
    documentationUrl: https://apicommons.org/rules/#json-structure-document-require-name
  json-structure-document-require-property:
    description: The `properties` property should be present.
    message: properties should be present
    severity: info
    given: $
    then:
      field: properties
      function: truthy
    documentationUrl: https://apicommons.org/rules/#json-structure-document-require-property
  json-structure-document-require-type:
    description: The `type` property should be present.
    message: type should be present
    severity: info
    given: $
    then:
      field: type
      function: truthy
    documentationUrl: https://apicommons.org/rules/#json-structure-document-require-type
  json-structure-schema-json-structure-property-require-type:
    description: Properties should declare a type.
    message: Property should declare a type.
    given: $.properties[*]
    severity: info
    then:
      field: type
      function: truthy
    documentationUrl: https://apicommons.org/rules/#json-structure-schema-json-structure-property-require-type
  json-structure-schema-json-structure-root-type-object:
    description: The root type of a JSON Structure document is typically object.
    message: Root type should usually be object.
    given: $.type
    severity: info
    then:
      function: pattern
      functionOptions:
        match: ^object$
    documentationUrl: https://apicommons.org/rules/#json-structure-schema-json-structure-root-type-object
  json-structure-schema-property-require-type:
    description: The `type` property of each property should be present.
    message: type should be present
    severity: info
    given: $.properties[*]
    then:
      field: type
      function: truthy
    documentationUrl: https://apicommons.org/rules/#json-structure-schema-property-require-type
  json-structure-schema-require:
    description: The `$schema` property should be present.
    message: $schema should be present
    severity: info
    given: $
    then:
      field: $schema
      function: truthy
    documentationUrl: https://apicommons.org/rules/#json-structure-schema-require
  json-ld-document-require-context:
    description: The `@context` property should be present.
    message: '@context should be present'
    severity: info
    given: $
    then:
      field: '@context'
      function: truthy
    documentationUrl: https://apicommons.org/rules/#json-ld-document-require-context
  json-ld-document-require-id:
    description: The `@id` property should be present.
    message: '@id should be present'
    severity: info
    given: $
    then:
      field: '@id'
      function: truthy
    documentationUrl: https://apicommons.org/rules/#json-ld-document-require-id
  json-ld-document-require-type:
    description: The `@type` property should be present.
    message: '@type should be present'
    severity: info
    given: $
    then:
      field: '@type'
      function: truthy
    documentationUrl: https://apicommons.org/rules/#json-ld-document-require-type
  json-ld-schema-json-ld-context-uri-or-object:
    description: '@context should be a URI string, an inline object, or an array of those.'
    message: '@context should be a URI, object, or array.'
    given: $['@context']
    severity: info
    then:
      function: schema
      functionOptions:
        schema:
          type:
          - string
          - object
          - array
    documentationUrl: https://apicommons.org/rules/#json-ld-schema-json-ld-context-uri-or-object
  json-ld-schema-json-ld-type-string-or-array:
    description: '@type should be a string or an array of type strings.'
    message: '@type should be a string or array.'
    given: $['@type']
    severity: info
    then:
      function: schema
      functionOptions:
        schema:
          type:
          - string
          - array
    documentationUrl: https://apicommons.org/rules/#json-ld-schema-json-ld-type-string-or-array
  mcp-capability-require-prompts:
    description: The `prompts` property of each capability should be present.
    message: prompts should be present
    severity: info
    given: $.capabilities
    then:
      field: prompts
      function: truthy
    documentationUrl: https://apicommons.org/rules/#mcp-capability-require-prompts
  mcp-capability-require-resources:
    description: The `resources` property of each capability should be present.
    message: resources should be present
    severity: info
    given: $.capabilities
    then:
      field: resources
      function: truthy
    documentationUrl: https://apicommons.org/rules/#mcp-capability-require-resources
  mcp-capability-require-tools:
    description: The `tools` property of each capability should be present.
    message: tools should be present
    severity: info
    given: $.capabilities
    then:
      field: tools
      function: truthy
    documentationUrl: https://apicommons.org/rules/#mcp-capability-require-tools
  mcp-document-require-capabilities:
    description: The `capabilities` property should be present.
    message: capabilities should be present
    severity: info
    given: $
    then:
      field: capabilities
      function: truthy
    documentationUrl: https://apicommons.org/rules/#mcp-document-require-capabilities
  mcp-document-require-description:
    description: The `description` property should be present.
    message: description should be present
    severity: info
    given: $
    then:
      field: description
      function: truthy
    documentationUrl: https://apicommons.org/rules/#mcp-document-require-description
  mcp-document-require-name:
    description: The `name` property should be present.
    message: name should be present
    severity: info
    given: $
    then:
      field: name
      function: truthy
    documentationUrl: https://apicommons.org/rules/#mcp-document-require-name
  mcp-info-skill-require-version:
    description: The `version` property should be present.
    message: version should be present
    severity: info
    given: $
    then:
      field: version
      function: truthy
    documentationUrl: https://apicommons.org/rules/#mcp-info-skill-require-version
  plans-document-require-name:
    description: The `name` property should be present.
    message: name should be present
    severity: info
    given: $
    then:
      field: name
      function: truthy
    documentationUrl: https://apicommons.org/rules/#plans-document-require-name
  plans-document-require-plan:
    description: The `plans` property should be present.
    message: plans should be present
    severity: info
    given: $
    then:
      field: plans
      function: truthy
    documentationUrl: https://apicommons.org/rules/#plans-document-require-plan
  plans-plan-currency-iso4217:
    description: currency should be a 3-letter ISO 4217 code (e.g. USD).
    message: currency should be an ISO 4217 code.
    given: $.currency
    severity: info
    then:
      function: pattern
      functionOptions:
        match: ^[A-Z]{3}$
    documentationUrl: https://apicommons.org/rules/#plans-plan-currency-iso4217
  plans-plan-price-non-negative:
    description: A plan price should be a non-negative number.
    message: Plan price should be a non-negative number.
    given: $.plans[*].price
    severity: info
    then:
      function: schema
      functionOptions:
        schema:
          type:
          - number
          - integer
          minimum: 0
    documentationUrl: https://apicommons.org/rules/#plans-plan-price-non-negative
  plans-plan-require-name:
    description: The `name` property of each plan should be present.
    message: name should be present
    severity: info
    given: $.plans[*]
    then:
      field: name
      function: truthy
    documentationUrl: https://apicommons.org/rules/#plans-plan-require-name
  rate-limits-document-require-limit:
    description: The `limits` property should be present.
    message: limits should be present
    severity: info
    given: $
    then:
      field: limits
      function: truthy
    documentationUrl: https://apicommons.org/rules/#rate-limits-document-require-limit
  rate-limits-document-require-name:
    description: The `name` property should be present.
    message: name should be present
    severity: info
    given: $
    then:
      field: name
      function: truthy
    documentationUrl: https://apicommons.org/rules/#rate-limits-document-require-name
  rate-limits-limit-max-positive:
    description: A limit max should be a positive integer.
    message: Limit max should be a positive integer.
    given: $.limits[*].max
    severity: info
    then:
      function: schema
      functionOptions:
        schema:
          type: integer
          minimum: 1
    documentationUrl: https://apicommons.org/rules/#rate-limits-limit-max-positive
  rate-limits-limit-require-name:
    description: The `name` property of each limit should be present.
    message: name should be present
    severity: info
    given: $.limits[*]
    then:
      field: name
      function: truthy
    documentationUrl: https://apicommons.org/rules/#rate-limits-limit-require-name
  finops-cost-finops-monthly-non-negative:
    description: A cost monthly amount should be a non-negative number.
    message: Cost monthly should be a non-negative number.
    given: $.costs[*].monthly
    severity: info
    then:
      function: schema
      functionOptions:
        schema:
          type:
          - number
          - integer
          minimum: 0
    documentationUrl: https://apicommons.org/rules/#finops-cost-finops-monthly-non-negative
  finops-cost-finops-require-monthly:
    description: The `monthly` property of each cost should be present.
    message: monthly should be present
    severity: info
    given: $.costs[*]
    then:
      field: monthly
      function: truthy
    documentationUrl: https://apicommons.org/rules/#finops-cost-finops-require-monthly
  finops-cost-finops-require-service:
    description: The `service` property of each cost should be present.
    message: service should be present
    severity: info
    given: $.costs[*]
    then:
      field: service
      function: truthy
    documentationUrl: https://apicommons.org/rules/#finops-cost-finops-require-service
  finops-document-finops-budget-non-negative:
    description: budget should be a non-negative number.
    message: budget should be a non-negative number.
    given: $.budget
    severity: info
    then:
      function: schema
      functionOptions:
        schema:
          type:
          - number
          - integer
          minimum: 0
    documentationUrl: https://apicommons.org/rules/#finops-document-finops-budget-non-negative
  finops-document-finops-currency-iso4217:
    description: currency should be a 3-letter ISO 4217 code (e.g. USD).
    message: currency should be an ISO 4217 code.
    given: $.currency
    severity: info
    then:
      function: pattern
      functionOptions:
        match: ^[A-Z]{3}$
    documentationUrl: https://apicommons.org/rules/#finops-document-finops-currency-iso4217
  finops-document-finops-require-budget:
    description: The `budget` property should be present.
    message: budget should be present
    severity: info
    given: $
    then:
      field: budget
      function: truthy
    documentationUrl: https://apicommons.org/rules/#finops-document-finops-require-budget
  finops-document-finops-require-cost:
    description: The `costs` property should be present.
    message: costs should be present
    severity: info
    given: $
    then:
      field: costs
      function: truthy
    documentationUrl: https://apicommons.org/rules/#finops-document-finops-require-cost
  finops-document-finops-require-currency:
    description: The `currency` property should be present.
    message: currency should be present
    severity: info
    given: $
    then:
      field: currency
      function: truthy
    documentationUrl: https://apicommons.org/rules/#finops-document-finops-require-currency
  finops-document-finops-require-name:
    description: The `name` property should be present.
    message: name should be present
    severity: info
    given: $
    then:
      field: name
      function: truthy
    documentationUrl: https://apicommons.org/rules/#finops-document-finops-require-name
  agent-skill-skill-metadata-object:
    description: If a skill declares metadata, it should be an object of key/value pairs.
    message: Skill metadata should be an object.
    given: $.frontmatter.metadata
    severity: info
    then:
      function: schema
      functionOptions:
        schema:
          type: object
    documentationUrl: https://apicommons.org/rules/#agent-skill-skill-metadata-object
