documentationUrl: https://spotlight-rules.com/spec/
functions:
- digitalocean-ensureSnakeCaseWithDigits
- trimble-invalid-symbol-in-path
- trimble-no-http-verbs-in-path
functionsDir: ./functions
rules:
  openapi-component-example-keys-snake-case:
    title: Component Example Keys Snake Case
    reference: https://spotlight-rules.com/spec/rules/openapi/component-example-keys-snake-case/
    description: example key must be snake cased (e.g. snake_case).
    message: '{{error}}'
    severity: info
    given: $.components['examples'].*~
    then:
      function: digitalocean-ensureSnakeCaseWithDigits
    tags:
    - format:openapi
    - spec:components
    - spec:examples
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''component-example-keys-snake-case''
      (Component Example Keys Snake Case). Requirement: example key must be snake cased (e.g. snake_case). This rule is evaluated
      at the JSONPath `$.components[''examples''].*~` — inspect every location it matches and correct only what violates the
      rule. Make the smallest change that satisfies the rule, leave all unrelated content, key order, comments, and formatting
      unchanged, and keep the document valid OpenAPI. Return only the complete corrected document, with no commentary.'
  openapi-header-names-hyphenated-pascal-case:
    title: Header Names Hyphenated Pascal Case
    reference: https://spotlight-rules.com/spec/rules/openapi/header-names-hyphenated-pascal-case/
    description: All `HTTP` headers MUST use `Hyphenated-Pascal-Case` notation.
    message: '''HTTP'' headers MUST follow ''Hyphenated-Pascal-Case'' notation'
    severity: info
    given: $..parameters[?(@.in == 'header')].name
    then:
      function: pattern
      functionOptions:
        match: /^([A-Z][a-z0-9]-)*([A-Z][a-z0-9])+/
    tags:
    - format:openapi
    - spec:parameters
    - spec:headers
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''header-names-hyphenated-pascal-case''
      (Header Names Hyphenated Pascal Case). Requirement: All `HTTP` headers MUST use `Hyphenated-Pascal-Case` notation. To
      fix: Ensure the targeted value matches the regular expression `/^([A-Z][a-z0-9]-)*([A-Z][a-z0-9])+/`; rewrite any value
      that does not. This rule is evaluated at the JSONPath `$..parameters[?(@.in == ''header'')].name` — inspect every location
      it matches and correct only what violates the rule. Make the smallest change that satisfies the rule, leave all unrelated
      content, key order, comments, and formatting unchanged, and keep the document valid OpenAPI. Return only the complete
      corrected document, with no commentary.'
  openapi-header-no-x-prefix:
    title: Header No X Prefix
    reference: https://spotlight-rules.com/spec/rules/openapi/header-no-x-prefix/
    description: '''HTTP'' headers SHOULD NOT start with ''X-'' RFC6648.'
    message: HTTP header '{{value}}' SHOULD NOT start with 'X-' in {{path}}
    severity: info
    given:
    - $..parameters[?(@.in == 'header')].name
    then:
      function: pattern
      functionOptions:
        match: /^([^x]|.[^-])|RateLimit-/i
    tags:
    - format:openapi
    - spec:parameters
    - spec:headers
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''header-no-x-prefix'' (Header
      No X Prefix). Requirement: ''HTTP'' headers SHOULD NOT start with ''X-'' RFC6648. To fix: Ensure the targeted value
      matches the regular expression `/^([^x]|.[^-])|RateLimit-/i`; rewrite any value that does not. This rule is evaluated
      at the JSONPath `$..parameters[?(@.in == ''header'')].name` — inspect every location it matches and correct only what
      violates the rule. Make the smallest change that satisfies the rule, leave all unrelated content, key order, comments,
      and formatting unchanged, and keep the document valid OpenAPI. Return only the complete corrected document, with no
      commentary.'
  openapi-info-title-capitalized:
    title: Info Title Capitalized
    reference: https://spotlight-rules.com/spec/rules/openapi/info-title-capitalized/
    description: Having a consistent casing for the title for your API helps provide constraints for teams naming the API,
      but also keep consistent with other APIs from across teams.
    message: Info Title Has First Characters Capitalized
    severity: info
    given: $.info.title
    then:
      function: pattern
      functionOptions:
        match: '[A-Z]\w*'
    tags:
    - format:openapi
    - spec:info
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''info-title-capitalized'' (Info
      Title Capitalized). Requirement: Having a consistent casing for the title for your API helps provide constraints for
      teams naming the API, but also keep consistent with other APIs from across teams. To fix: Ensure the targeted value
      matches the regular expression `[A-Z]\w*`; rewrite any value that does not. This rule is evaluated at the JSONPath `$.info.title`
      — inspect every location it matches and correct only what violates the rule. Make the smallest change that satisfies
      the rule, leave all unrelated content, key order, comments, and formatting unchanged, and keep the document valid OpenAPI.
      Return only the complete corrected document, with no commentary.'
  openapi-operation-id-camel-case:
    title: Operation ID Camel Case
    reference: https://spotlight-rules.com/spec/rules/openapi/operation-id-camel-case/
    description: Operation identifiers provide a unique way to identify each individual API, and requiring them to have consistent
      casing reduces friction when generating SDKs and automating around APIs.
    message: Operation Identifier MUST Be camelCase
    severity: info
    given: $.paths.*[get,post,patch,put,delete].operationId
    then:
    - function: pattern
      functionOptions:
        match: ^[a-z]+(?:[A-Z][a-z]+)*$
    tags:
    - format:openapi
    - spec:paths
    - spec:operations
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''operation-id-camel-case''
      (Operation ID Camel Case). Requirement: Operation identifiers provide a unique way to identify each individual API,
      and requiring them to have consistent casing reduces friction when generating SDKs and automating around APIs. To fix:
      Ensure the targeted value matches the regular expression `^[a-z]+(?:[A-Z][a-z]+)*$`; rewrite any value that does not.
      This rule is evaluated at the JSONPath `$.paths.*[get,post,patch,put,delete].operationId` — inspect every location it
      matches and correct only what violates the rule. Make the smallest change that satisfies the rule, leave all unrelated
      content, key order, comments, and formatting unchanged, and keep the document valid OpenAPI. Return only the complete
      corrected document, with no commentary.'
  openapi-operation-id-url-safe:
    title: Operation ID URL Safe
    reference: https://spotlight-rules.com/spec/rules/openapi/operation-id-url-safe/
    description: OperationId must use URL friendly characters.
    message: OperationId must use URL friendly characters.
    severity: info
    given: $.paths[*][*]
    then:
      field: operationId
      function: pattern
      functionOptions:
        match: ^[A-Za-z0-9-._~:/?#\[\]@!\$&'()*+,;=]*$
    formats:
    - oas3
    - oas3_1
    tags:
    - format:openapi
    - spec:paths
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''operation-id-url-safe'' (Operation
      ID URL Safe). Requirement: OperationId must use URL friendly characters. To fix: Ensure `operationId` matches the regular
      expression `^[A-Za-z0-9-._~:/?#\[\]@!\$&''()*+,;=]*$`; rewrite any value that does not. This rule is evaluated at the
      JSONPath `$.paths[*][*]` — inspect every location it matches and correct only what violates the rule. Make the smallest
      change that satisfies the rule, leave all unrelated content, key order, comments, and formatting unchanged, and keep
      the document valid OpenAPI. Return only the complete corrected document, with no commentary.'
  openapi-operation-tag-title-case:
    title: Operation Tag Title Case
    reference: https://spotlight-rules.com/spec/rules/openapi/operation-tag-title-case/
    description: Having the first letter of each word applied as a tag to API operations helps keep a consistent layout when
      published via search, documentation, and other ways APIs are made available.
    message: Operation Tag Names MUST Have First Letter in Each Word Capitalized
    severity: info
    given: $.paths.*[get,post,patch,put,delete].tags.*
    then:
      function: pattern
      functionOptions:
        match: '[A-Z]\w*'
    tags:
    - format:openapi
    - spec:paths
    - spec:operations
    - spec:tags
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''operation-tag-title-case''
      (Operation Tag Title Case). Requirement: Having the first letter of each word applied as a tag to API operations helps
      keep a consistent layout when published via search, documentation, and other ways APIs are made available. To fix: Ensure
      the targeted value matches the regular expression `[A-Z]\w*`; rewrite any value that does not. This rule is evaluated
      at the JSONPath `$.paths.*[get,post,patch,put,delete].tags.*` — inspect every location it matches and correct only what
      violates the rule. Make the smallest change that satisfies the rule, leave all unrelated content, key order, comments,
      and formatting unchanged, and keep the document valid OpenAPI. Return only the complete corrected document, with no
      commentary.'
  openapi-parameter-enum-upper-snake-case:
    title: Parameter Enum Upper Snake Case
    reference: https://spotlight-rules.com/spec/rules/openapi/parameter-enum-upper-snake-case/
    description: Keeping parameters enumerator casing consistent across APIs helps reduce confusion by consumers, and can
      keep aligned with services and applications putting an API to work.
    message: Parameters Enums MUST Must Be Upper Snake Case
    severity: info
    given: $.components.parameters.*.enum.*
    then:
      function: pattern
      functionOptions:
        notMatch: ^[A-Z]+(?:_[A-Z]+)*$
    tags:
    - format:openapi
    - spec:parameters
    - spec:components
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''parameter-enum-upper-snake-case''
      (Parameter Enum Upper Snake Case). Requirement: Keeping parameters enumerator casing consistent across APIs helps reduce
      confusion by consumers, and can keep aligned with services and applications putting an API to work. To fix: Ensure the
      targeted value does NOT match the regular expression `^[A-Z]+(?:_[A-Z]+)*$`; rename or rewrite any value that does.
      This rule is evaluated at the JSONPath `$.components.parameters.*.enum.*` — inspect every location it matches and correct
      only what violates the rule. Make the smallest change that satisfies the rule, leave all unrelated content, key order,
      comments, and formatting unchanged, and keep the document valid OpenAPI. Return only the complete corrected document,
      with no commentary.'
  openapi-parameter-keys-snake-case:
    title: Parameter Keys Snake Case
    reference: https://spotlight-rules.com/spec/rules/openapi/parameter-keys-snake-case/
    description: parameter key must be snake cased (e.g. snake_case).
    message: '{{error}}'
    severity: info
    given: $.components['parameters'].*~
    then:
      function: digitalocean-ensureSnakeCaseWithDigits
    tags:
    - format:openapi
    - spec:parameters
    - spec:components
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''parameter-keys-snake-case''
      (Parameter Keys Snake Case). Requirement: parameter key must be snake cased (e.g. snake_case). This rule is evaluated
      at the JSONPath `$.components[''parameters''].*~` — inspect every location it matches and correct only what violates
      the rule. Make the smallest change that satisfies the rule, leave all unrelated content, key order, comments, and formatting
      unchanged, and keep the document valid OpenAPI. Return only the complete corrected document, with no commentary.'
  openapi-parameter-name-max-length:
    title: Parameter Name Max Length
    reference: https://spotlight-rules.com/spec/rules/openapi/parameter-name-max-length/
    severity: info
    description: Providing short and concise names for your parameters helps make it easier for API consumers to understand
      how they are able to configure their API requests.
    message: Parameters Name Length MUST Be Less Than 25 Characters
    given: $.components.parameters[?(@.in=='path')].name
    then:
      field: summary
      function: length
      functionOptions:
        max: 25
    tags:
    - format:openapi
    - spec:parameters
    - spec:components
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''parameter-name-max-length''
      (Parameter Name Max Length). Requirement: Providing short and concise names for your parameters helps make it easier
      for API consumers to understand how they are able to configure their API requests. To fix: Ensure the length of `summary`
      is at most 25. This rule is evaluated at the JSONPath `$.components.parameters[?(@.in==''path'')].name` — inspect every
      location it matches and correct only what violates the rule. Make the smallest change that satisfies the rule, leave
      all unrelated content, key order, comments, and formatting unchanged, and keep the document valid OpenAPI. Return only
      the complete corrected document, with no commentary.'
  openapi-parameter-names-camel-case:
    title: Parameter Names Camel Case
    reference: https://spotlight-rules.com/spec/rules/openapi/parameter-names-camel-case/
    description: Providing parameters with consistent naming helps make it easier for API consumers to understand how they
      are able to configure their API requests.
    message: Parameters Names MUST Be Camel Case
    severity: info
    given: $.components.parameters.*
    then:
    - field: name
      function: pattern
      functionOptions:
        notMatch: ^[a-z]+(?:[A-Z][a-z]+)*$
    - field: name
      function: pattern
      functionOptions:
        match: ^[A-Z](([a-z0-9]+[A-Z]?)*)$
    tags:
    - format:openapi
    - spec:parameters
    - spec:components
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''parameter-names-camel-case''
      (Parameter Names Camel Case). Requirement: Providing parameters with consistent naming helps make it easier for API
      consumers to understand how they are able to configure their API requests. To fix: Ensure `name` does NOT match the
      regular expression `^[a-z]+(?:[A-Z][a-z]+)*$`; rename or rewrite any value that does. Also: Ensure `name` matches the
      regular expression `^[A-Z](([a-z0-9]+[A-Z]?)*)$`; rewrite any value that does not. This rule is evaluated at the JSONPath
      `$.components.parameters.*` — inspect every location it matches and correct only what violates the rule. Make the smallest
      change that satisfies the rule, leave all unrelated content, key order, comments, and formatting unchanged, and keep
      the document valid OpenAPI. Return only the complete corrected document, with no commentary.'
  openapi-parameter-no-x-prefixed-request-header:
    title: Parameter No X Prefixed Request Header
    reference: https://spotlight-rules.com/spec/rules/openapi/parameter-no-x-prefixed-request-header/
    description: Do not use headers with X-.
    message: 'Headers cannot start with X-. More: https://tools.ietf.org/html/rfc6648'
    severity: info
    given: $..parameters.[?(@.in === 'header')].name
    then:
      function: pattern
      functionOptions:
        notMatch: ^(x|X)-
    tags:
    - format:openapi
    - spec:parameters
    - spec:headers
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''parameter-no-x-prefixed-request-header''
      (Parameter No X Prefixed Request Header). Requirement: Do not use headers with X-. To fix: Ensure the targeted value
      does NOT match the regular expression `^(x|X)-`; rename or rewrite any value that does. This rule is evaluated at the
      JSONPath `$..parameters.[?(@.in === ''header'')].name` — inspect every location it matches and correct only what violates
      the rule. Make the smallest change that satisfies the rule, leave all unrelated content, key order, comments, and formatting
      unchanged, and keep the document valid OpenAPI. Return only the complete corrected document, with no commentary.'
  openapi-parameter-query-allowed-characters:
    title: Parameter Query Allowed Characters
    reference: https://spotlight-rules.com/spec/rules/openapi/parameter-query-allowed-characters/
    description: 'Query parameter keys MUST include only alpha-numeric characters and periods: [Aa0-Zz9]''.'
    message: 'Query parameter keys MUST include only alpha-numeric characters and periods: [Aa0-Zz9]''.'
    severity: info
    given: $.paths.*.*.parameters[?(@.in=='query')].name
    then:
      function: pattern
      functionOptions:
        match: ^[A-Za-z0-9\.]+$
    tags:
    - format:openapi
    - spec:paths
    - spec:parameters
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''parameter-query-allowed-characters''
      (Parameter Query Allowed Characters). Requirement: Query parameter keys MUST include only alpha-numeric characters and
      periods: [Aa0-Zz9]''. To fix: Ensure the targeted value matches the regular expression `^[A-Za-z0-9\.]+$`; rewrite any
      value that does not. This rule is evaluated at the JSONPath `$.paths.*.*.parameters[?(@.in==''query'')].name` — inspect
      every location it matches and correct only what violates the rule. Make the smallest change that satisfies the rule,
      leave all unrelated content, key order, comments, and formatting unchanged, and keep the document valid OpenAPI. Return
      only the complete corrected document, with no commentary.'
  openapi-parameter-query-camel-case:
    title: Parameter Query Camel Case
    reference: https://spotlight-rules.com/spec/rules/openapi/parameter-query-camel-case/
    description: MUST query parameter names must be ASCII camelCase [130a].
    message: Query parameter name has to be ASCII camelCase
    severity: info
    given: $.paths.*.*.parameters[?(@ && @.in=='query')].name
    then:
      function: pattern
      functionOptions:
        match: ^[a-z]+((\d)|([A-Z0-9][a-z0-9]+))*([A-Z])?$
    tags:
    - format:openapi
    - spec:paths
    - spec:parameters
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''parameter-query-camel-case''
      (Parameter Query Camel Case). Requirement: MUST query parameter names must be ASCII camelCase [130a]. To fix: Ensure
      the targeted value matches the regular expression `^[a-z]+((\d)|([A-Z0-9][a-z0-9]+))*([A-Z])?$`; rewrite any value that
      does not. This rule is evaluated at the JSONPath `$.paths.*.*.parameters[?(@ && @.in==''query'')].name` — inspect every
      location it matches and correct only what violates the rule. Make the smallest change that satisfies the rule, leave
      all unrelated content, key order, comments, and formatting unchanged, and keep the document valid OpenAPI. Return only
      the complete corrected document, with no commentary.'
  openapi-parameter-require-name:
    title: Parameter Require Name
    reference: https://spotlight-rules.com/spec/rules/openapi/parameter-require-name/
    description: Providing a simple, intuitive, and consistent names for your parameters helps make it easier for API consumers
      to understand how they are able to configure their API requests.
    message: Parameters MUST Have a Name
    severity: info
    given: $.components.parameters.*
    then:
      field: name
      function: truthy
    tags:
    - format:openapi
    - spec:parameters
    - spec:components
    - experience:naming
    - experience:documentation
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''parameter-require-name'' (Parameter
      Require Name). Requirement: Providing a simple, intuitive, and consistent names for your parameters helps make it easier
      for API consumers to understand how they are able to configure their API requests. To fix: Ensure `name` is present
      and non-empty at each matching location. This rule is evaluated at the JSONPath `$.components.parameters.*` — inspect
      every location it matches and correct only what violates the rule. Make the smallest change that satisfies the rule,
      leave all unrelated content, key order, comments, and formatting unchanged, and keep the document valid OpenAPI. Return
      only the complete corrected document, with no commentary.'
  openapi-path-no-api-prefix-in:
    title: Path No API Prefix In
    reference: https://spotlight-rules.com/spec/rules/openapi/path-no-api-prefix-in/
    description: A resource SHOULD NOT contain 'api' as a prefix in or a part of the path.
    message: A resource SHOULD NOT contain 'api' as a prefix in or a part of the path.
    severity: info
    given: $.paths.*~
    then:
      function: pattern
      functionOptions:
        notMatch: /api|/api/|-api/
    tags:
    - format:openapi
    - spec:paths
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''path-no-api-prefix-in'' (Path
      No API Prefix In). Requirement: A resource SHOULD NOT contain ''api'' as a prefix in or a part of the path. To fix:
      Ensure the targeted value does NOT match the regular expression `/api|/api/|-api/`; rename or rewrite any value that
      does. This rule is evaluated at the JSONPath `$.paths.*~` — inspect every location it matches and correct only what
      violates the rule. Make the smallest change that satisfies the rule, leave all unrelated content, key order, comments,
      and formatting unchanged, and keep the document valid OpenAPI. Return only the complete corrected document, with no
      commentary.'
  openapi-path-no-empty-segment:
    title: Path No Empty Segment
    reference: https://spotlight-rules.com/spec/rules/openapi/path-no-empty-segment/
    description: A resource MUST use normalized paths without empty path segments.
    message: A resource MUST use normalized paths without empty path segments.
    severity: info
    given: $.paths.*~
    then:
      function: pattern
      functionOptions:
        notMatch: //
    tags:
    - format:openapi
    - spec:paths
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''path-no-empty-segment'' (Path
      No Empty Segment). Requirement: A resource MUST use normalized paths without empty path segments. To fix: Ensure the
      targeted value does NOT match the regular expression `//`; rename or rewrite any value that does. This rule is evaluated
      at the JSONPath `$.paths.*~` — inspect every location it matches and correct only what violates the rule. Make the smallest
      change that satisfies the rule, leave all unrelated content, key order, comments, and formatting unchanged, and keep
      the document valid OpenAPI. Return only the complete corrected document, with no commentary.'
  openapi-path-no-environment-names-in:
    title: Path No Environment Names In
    reference: https://spotlight-rules.com/spec/rules/openapi/path-no-environment-names-in/
    description: API paths MUST NOT indicate environment names.
    message: API paths MUST NOT indicate environment names.
    severity: info
    given: $.paths.*~
    then:
      function: pattern
      functionOptions:
        notMatch: /prod/|/preprod/|/dev/|/test/|/integration/|/stage/
    tags:
    - format:openapi
    - spec:paths
    - experience:naming
    - experience:governance
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''path-no-environment-names-in''
      (Path No Environment Names In). Requirement: API paths MUST NOT indicate environment names. To fix: Ensure the targeted
      value does NOT match the regular expression `/prod/|/preprod/|/dev/|/test/|/integration/|/stage/`; rename or rewrite
      any value that does. This rule is evaluated at the JSONPath `$.paths.*~` — inspect every location it matches and correct
      only what violates the rule. Make the smallest change that satisfies the rule, leave all unrelated content, key order,
      comments, and formatting unchanged, and keep the document valid OpenAPI. Return only the complete corrected document,
      with no commentary.'
  openapi-path-no-file-extension-in:
    title: Path No File Extension In
    reference: https://spotlight-rules.com/spec/rules/openapi/path-no-file-extension-in/
    description: A resource SHOULD NOT make use of an extension at any point in the path.
    message: A resource SHOULD NOT make use of an extension at any point in the path.
    severity: info
    given: $.paths.*~
    then:
      function: pattern
      functionOptions:
        notMatch: \.
    tags:
    - format:openapi
    - spec:paths
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''path-no-file-extension-in''
      (Path No File Extension In). Requirement: A resource SHOULD NOT make use of an extension at any point in the path. To
      fix: Ensure the targeted value does NOT match the regular expression `\.`; rename or rewrite any value that does. This
      rule is evaluated at the JSONPath `$.paths.*~` — inspect every location it matches and correct only what violates the
      rule. Make the smallest change that satisfies the rule, leave all unrelated content, key order, comments, and formatting
      unchanged, and keep the document valid OpenAPI. Return only the complete corrected document, with no commentary.'
  openapi-path-no-file-extensions:
    title: Path No File Extensions
    reference: https://spotlight-rules.com/spec/rules/openapi/path-no-file-extensions/
    description: API paths should not include file extensions like .json or .xml. Content negotiation should be handled through
      Accept headers rather than path suffixes.
    message: Paths MUST NOT Contain File Extensions
    severity: info
    given: $.paths
    then:
      function: pattern
      functionOptions:
        notMatch: \.(json|xml|html|yaml|yml|csv|pdf)$
    tags:
    - format:openapi
    - spec:paths
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''path-no-file-extensions''
      (Path No File Extensions). Requirement: API paths should not include file extensions like .json or .xml. Content negotiation
      should be handled through Accept headers rather than path suffixes. To fix: Ensure the targeted value does NOT match
      the regular expression `\.(json|xml|html|yaml|yml|csv|pdf)$`; rename or rewrite any value that does. This rule is evaluated
      at the JSONPath `$.paths` — inspect every location it matches and correct only what violates the rule. Make the smallest
      change that satisfies the rule, leave all unrelated content, key order, comments, and formatting unchanged, and keep
      the document valid OpenAPI. Return only the complete corrected document, with no commentary.'
  openapi-path-no-format-extensions-in:
    title: Path No Format Extensions In
    reference: https://spotlight-rules.com/spec/rules/openapi/path-no-format-extensions-in/
    description: Request and Response media type formats MUST NOT be implied using extensions on resources (i.e. .json or
      .xml). Instead, use the standard resource path with the appropriate Content-Type header.
    message: Request and Response media type formats MUST NOT be implied using extensions on resources (i.e.
    severity: info
    given: $.paths.*~
    then:
      function: pattern
      functionOptions:
        notMatch: \.json|\.xml|\.yml|\.yaml
    tags:
    - format:openapi
    - spec:paths
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''path-no-format-extensions-in''
      (Path No Format Extensions In). Requirement: Request and Response media type formats MUST NOT be implied using extensions
      on resources (i.e. .json or .xml). Instead, use the standard resource path with the appropriate Content-Type header.
      To fix: Ensure the targeted value does NOT match the regular expression `\.json|\.xml|\.yml|\.yaml`; rename or rewrite
      any value that does. This rule is evaluated at the JSONPath `$.paths.*~` — inspect every location it matches and correct
      only what violates the rule. Make the smallest change that satisfies the rule, leave all unrelated content, key order,
      comments, and formatting unchanged, and keep the document valid OpenAPI. Return only the complete corrected document,
      with no commentary.'
  openapi-path-no-http-method-names:
    title: Path No HTTP Method Names
    reference: https://spotlight-rules.com/spec/rules/openapi/path-no-http-method-names/
    description: 'When you design a REST API, you don''t usually need to mention terms like `get`, `delete` and so on in your
      `paths`, because this information is conveyed by the HTTP method. Instead of using ``` POST /books/1234/delete HTTP/1.1
      Host: api.example ``` You can simply call ``` DELETE /books/1234 HTTP/1.1 Host: api.example ``` Similarly you don''t
      need verbs like `list` or `create` because the HTTP Semantics RFC7231 supports this kind of actions natively with proper
      methods and status code. Instead of ``` POST /create/user HTTP/1.1 Host: api.example Content-Type: application/json
      {"given_name": "Mario"} ``` You can use ``` POST /create/user HTTP/1.1 Host: api.example Content-Type: application/json
      {"given_name": "Mario"} ``` returning a proper response ``` HTTP/1.1 201 Created Location: /users/1234 ``` This simplifies
      securing your API as you know beforehand the kind of action which is going to be performed.'
    message: API "path" contains a name of an http method. {{error}}
    severity: info
    given:
    - $.paths[?(@property.match( /\/(get|post|put|delete|patch)[\/A-Z_\-]?/ ))]~
    - $.paths[?(@property.match( /\/(create|remove|list)[\/A-Z_\-]?/ ))]~
    then:
      field: '@key'
      function: undefined
    tags:
    - format:openapi
    - spec:paths
    - spec:operations
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''path-no-http-method-names''
      (Path No HTTP Method Names). Requirement: When you design a REST API, you don''t usually need to mention terms like
      `get`, `delete` and so on in your `paths`, because this information is conveyed by the HTTP method. Instead of using
      ``` POST /books/1234/delete HTTP/1.1 Host: api.example ``` You can simply call ``` DELETE /books/1234 HTTP/1.1 Host:
      api.example ``` Similarly you don''t need verbs like `list` or `create` because the HTTP Semantics RFC7231 supports
      this kind of actions natively with proper methods and status code. Instead of ``` POST /create/user HTTP/1.1 Host: api.example
      Content-Type: application/json {"given_name": "Mario"} ``` You can use ``` POST /create/user HTTP/1.1 Host: api.example
      Content-Type: application/json {"given_name": "Mario"} ``` returning a proper response ``` HTTP/1.1 201 Created Location:
      /users/1234 ``` This simplifies securing your API as you know beforehand the kind of action which is going to be performed.
      To fix: Remove `@key` from each matching location. This rule is evaluated at the JSONPath `$.paths[?(@property.match(
      /\/(get|post|put|delete|patch)[\/A-Z_\-]?/ ))]~ | $.paths[?(@property.match( /\/(create|remove|list)[\/A-Z_\-]?/ ))]~`
      — inspect every location it matches and correct only what violates the rule. Make the smallest change that satisfies
      the rule, leave all unrelated content, key order, comments, and formatting unchanged, and keep the document valid OpenAPI.
      Return only the complete corrected document, with no commentary.'
  openapi-path-no-http-methods-in:
    title: Path No HTTP Methods In
    reference: https://spotlight-rules.com/spec/rules/openapi/path-no-http-methods-in/
    description: A resource SHOULD NOT contain HTTP methods.
    message: A resource SHOULD NOT contain HTTP methods.
    severity: info
    given: $.paths.*~
    then:
      function: pattern
      functionOptions:
        notMatch: (\/get|\/post|\/put|\/delete|\/patch)
    tags:
    - format:openapi
    - spec:paths
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''path-no-http-methods-in''
      (Path No HTTP Methods In). Requirement: A resource SHOULD NOT contain HTTP methods. To fix: Ensure the targeted value
      does NOT match the regular expression `(\/get|\/post|\/put|\/delete|\/patch)`; rename or rewrite any value that does.
      This rule is evaluated at the JSONPath `$.paths.*~` — inspect every location it matches and correct only what violates
      the rule. Make the smallest change that satisfies the rule, leave all unrelated content, key order, comments, and formatting
      unchanged, and keep the document valid OpenAPI. Return only the complete corrected document, with no commentary.'
  openapi-path-no-http-verbs:
    title: Path No HTTP Verbs
    reference: https://spotlight-rules.com/spec/rules/openapi/path-no-http-verbs/
    severity: info
    description: HTTP verbs should be not be in URL paths.
    message: '{{property}} has HTTP verb in path: {{error}}'
    given: $.paths[*]~
    then:
      function: trimble-no-http-verbs-in-path
    tags:
    - format:openapi
    - spec:paths
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''path-no-http-verbs'' (Path
      No HTTP Verbs). Requirement: HTTP verbs should be not be in URL paths. This rule is evaluated at the JSONPath `$.paths`
      — inspect every location it matches and correct only what violates the rule. Make the smallest change that satisfies
      the rule, leave all unrelated content, key order, comments, and formatting unchanged, and keep the document valid OpenAPI.
      Return only the complete corrected document, with no commentary.'
  openapi-path-no-invalid-symbols:
    title: Path No Invalid Symbols
    reference: https://spotlight-rules.com/spec/rules/openapi/path-no-invalid-symbols/
    description: Check if the given endpoint has queryparameter.
    message: '{{error}}'
    severity: info
    given: $.paths[*]~
    then:
      function: trimble-invalid-symbol-in-path
    tags:
    - format:openapi
    - spec:paths
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''path-no-invalid-symbols''
      (Path No Invalid Symbols). Requirement: Check if the given endpoint has queryparameter. This rule is evaluated at the
      JSONPath `$.paths.` — inspect every location it matches and correct only what violates the rule. Make the smallest change
      that satisfies the rule, leave all unrelated content, key order, comments, and formatting unchanged, and keep the document
      valid OpenAPI. Return only the complete corrected document, with no commentary.'
  openapi-path-no-query-string:
    title: Path No Query String
    reference: https://spotlight-rules.com/spec/rules/openapi/path-no-query-string/
    description: Path must not include query string.
    message: Path must not include query string.
    severity: info
    given: $.paths
    then:
      function: pattern
      functionOptions:
        notMatch: \?
    formats:
    - oas3
    - oas3_1
    tags:
    - format:openapi
    - spec:paths
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''path-no-query-string'' (Path
      No Query String). Requirement: Path must not include query string. To fix: Ensure the targeted value does NOT match
      the regular expression `\?`; rename or rewrite any value that does. This rule is evaluated at the JSONPath `$.paths`
      — inspect every location it matches and correct only what violates the rule. Make the smallest change that satisfies
      the rule, leave all unrelated content, key order, comments, and formatting unchanged, and keep the document valid OpenAPI.
      Return only the complete corrected document, with no commentary.'
  openapi-path-no-query-strings-in:
    title: Path No Query Strings In
    reference: https://spotlight-rules.com/spec/rules/openapi/path-no-query-strings-in/
    description: Paths SHOULD NOT have query parameters in them. They should be defined separately in the OpenAPI.
    message: Paths SHOULD NOT have query parameters in them. They should be defined separately in the OpenAPI.
    severity: info
    given: $.paths.*~
    then:
      function: pattern
      functionOptions:
        notMatch: \?
    tags:
    - format:openapi
    - spec:paths
    - experience:consistency
    - experience:naming
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''path-no-query-strings-in''
      (Path No Query Strings In). Requirement: Paths SHOULD NOT have query parameters in them. They should be defined separately
      in the OpenAPI. To fix: Ensure the targeted value does NOT match the regular expression `\?`; rename or rewrite any
      value that does. This rule is evaluated at the JSONPath `$.paths.*~` — inspect every location it matches and correct
      only what violates the rule. Make the smallest change that satisfies the rule, leave all unrelated content, key order,
      comments, and formatting unchanged, and keep the document valid OpenAPI. Return only the complete corrected document,
      with no commentary.'
  openapi-path-no-technology-leak-in:
    title: Path No Technology Leak In
    reference: https://spotlight-rules.com/spec/rules/openapi/path-no-technology-leak-in/
    description: A resource MUST NOT leak or expose format or technology-specific information at any point in the path.
    message: A resource MUST NOT leak or expose format or technology-specific information at any point in the path.
    severity: info
    given: $.paths.*~
    then:
      function: pattern
      functionOptions:
        notMatch: (.php|.asp|.jsp|.cgi|.psp|.json|.xml)
    tags:
    - format:openapi
    - spec:paths
    - experience:security
    - experience:naming
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''path-no-technology-leak-in''
      (Path No Technology Leak In). Requirement: A resource MUST NOT leak or expose format or technology-specific information
      at any point in the path. To fix: Ensure the targeted value does NOT match the regular expression `(.php|.asp|.jsp|.cgi|.psp|.json|.xml)`;
      rename or rewrite any value that does. This rule is evaluated at the JSONPath `$.paths.*~` — inspect every location
      it matches and correct only what violates the rule. Make the smallest change that satisfies the rule, leave all unrelated
      content, key order, comments, and formatting unchanged, and keep the document valid OpenAPI. Return only the complete
      corrected document, with no commentary.'
  openapi-path-no-trailing-slash:
    title: Path No Trailing Slash
    reference: https://spotlight-rules.com/spec/rules/openapi/path-no-trailing-slash/
    description: Path must not end with a slash.
    message: Path must not end with a slash.
    severity: info
    given: $.paths
    then:
      function: pattern
      functionOptions:
        notMatch: .+\/$
    formats:
    - oas3
    - oas3_1
    tags:
    - format:openapi
    - spec:paths
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''path-no-trailing-slash'' (Path
      No Trailing Slash). Requirement: Path must not end with a slash. To fix: Ensure the targeted value does NOT match the
      regular expression `.+\/$`; rename or rewrite any value that does. This rule is evaluated at the JSONPath `$.paths`
      — inspect every location it matches and correct only what violates the rule. Make the smallest change that satisfies
      the rule, leave all unrelated content, key order, comments, and formatting unchanged, and keep the document valid OpenAPI.
      Return only the complete corrected document, with no commentary.'
  openapi-path-no-trailing-slash-in:
    title: Path No Trailing Slash In
    reference: https://spotlight-rules.com/spec/rules/openapi/path-no-trailing-slash-in/
    description: A resource MUST be addressable without a trailing slash on the path.
    message: A resource MUST be addressable without a trailing slash on the path.
    severity: info
    given: $.paths.*~
    then:
      function: pattern
      functionOptions:
        notMatch: /$
    tags:
    - format:openapi
    - spec:paths
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''path-no-trailing-slash-in''
      (Path No Trailing Slash In). Requirement: A resource MUST be addressable without a trailing slash on the path. To fix:
      Ensure the targeted value does NOT match the regular expression `/$`; rename or rewrite any value that does. This rule
      is evaluated at the JSONPath `$.paths.*~` — inspect every location it matches and correct only what violates the rule.
      Make the smallest change that satisfies the rule, leave all unrelated content, key order, comments, and formatting unchanged,
      and keep the document valid OpenAPI. Return only the complete corrected document, with no commentary.'
  openapi-path-no-verbs:
    title: Path No Verbs
    reference: https://spotlight-rules.com/spec/rules/openapi/path-no-verbs/
    description: API paths MUST be resource-focused and MUST NOT include verbs like 'get', 'update', 'create', or 'delete'.
    message: Path '{{path}}' includes a verb (e.g., 'get', 'update', 'create', 'delete'). API paths SHOULD be resource-focused.
    severity: info
    given: $.paths[*]~
    then:
      function: pattern
      functionOptions:
        notMatch: /\b(get|update|create|delete|fetch|retrieve)\b/
    formats:
    - oas3
    tags:
    - format:openapi
    - spec:paths
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''path-no-verbs'' (Path No Verbs).
      Requirement: API paths MUST be resource-focused and MUST NOT include verbs like ''get'', ''update'', ''create'', or
      ''delete''. To fix: Ensure the targeted value does NOT match the regular expression `/\b(get|update|create|delete|fetch|retrieve)\b/`;
      rename or rewrite any value that does. This rule is evaluated at the JSONPath `$.paths[*]~` — inspect every location
      it matches and correct only what violates the rule. Make the smallest change that satisfies the rule, leave all unrelated
      content, key order, comments, and formatting unchanged, and keep the document valid OpenAPI. Return only the complete
      corrected document, with no commentary.'
  openapi-path-no-x-prefixed-response-header:
    title: Path No X Prefixed Response Header
    reference: https://spotlight-rules.com/spec/rules/openapi/path-no-x-prefixed-response-header/
    description: Do not use headers with X-.
    message: 'Headers cannot start with X-, so please find a new name for {{property}}. More: https://tools.ietf.org/html/rfc6648'
    severity: info
    given: $..headers.*~
    then:
      function: pattern
      functionOptions:
        notMatch: ^(x|X)-
    tags:
    - format:openapi
    - spec:headers
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''path-no-x-prefixed-response-header''
      (Path No X Prefixed Response Header). Requirement: Do not use headers with X-. To fix: Ensure the targeted value does
      NOT match the regular expression `^(x|X)-`; rename or rewrite any value that does. This rule is evaluated at the JSONPath
      `$..headers.*~` — inspect every location it matches and correct only what violates the rule. Make the smallest change
      that satisfies the rule, leave all unrelated content, key order, comments, and formatting unchanged, and keep the document
      valid OpenAPI. Return only the complete corrected document, with no commentary.'
  openapi-path-parameter-camel-case:
    title: Path Parameter Camel Case
    reference: https://spotlight-rules.com/spec/rules/openapi/path-parameter-camel-case/
    description: Path parameters MUST follow camelCase.
    message: '{{property}} path parameter is not camelCase: {{error}}'
    severity: info
    given: $..parameters[?(@.in == 'path')].name
    then:
      function: pattern
      functionOptions:
        match: ^[a-z][a-zA-Z0-9]+$
    tags:
    - format:openapi
    - spec:parameters
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''path-parameter-camel-case''
      (Path Parameter Camel Case). Requirement: Path parameters MUST follow camelCase. To fix: Ensure the targeted value matches
      the regular expression `^[a-z][a-zA-Z0-9]+$`; rewrite any value that does not. This rule is evaluated at the JSONPath
      `$..parameters[?(@.in == ''path'')].name` — inspect every location it matches and correct only what violates the rule.
      Make the smallest change that satisfies the rule, leave all unrelated content, key order, comments, and formatting unchanged,
      and keep the document valid OpenAPI. Return only the complete corrected document, with no commentary.'
  openapi-path-parameter-constant-case:
    title: Path Parameter Constant Case
    reference: https://spotlight-rules.com/spec/rules/openapi/path-parameter-constant-case/
    description: Path parameters MUST follow CONSTANT_CASE (screaming snake_case).
    message: '{{property}} path parameter is not CONSTANT_CASE: {{error}}'
    severity: info
    given: $..parameters[?(@.in == 'path')].name
    then:
      function: pattern
      functionOptions:
        match: ^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$
    tags:
    - format:openapi
    - spec:parameters
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''path-parameter-constant-case''
      (Path Parameter Constant Case). Requirement: Path parameters MUST follow CONSTANT_CASE (screaming snake_case). To fix:
      Ensure the targeted value matches the regular expression `^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$`; rewrite any value that does
      not. This rule is evaluated at the JSONPath `$..parameters[?(@.in == ''path'')].name` — inspect every location it matches
      and correct only what violates the rule. Make the smallest change that satisfies the rule, leave all unrelated content,
      key order, comments, and formatting unchanged, and keep the document valid OpenAPI. Return only the complete corrected
      document, with no commentary.'
  openapi-path-parameter-kebab-case:
    title: Path Parameter Kebab Case
    reference: https://spotlight-rules.com/spec/rules/openapi/path-parameter-kebab-case/
    description: Path parameters MUST follow kebab-case.
    message: '{{property}} path parameter is not kebab-case: {{error}}'
    severity: info
    given: $..parameters[?(@.in == 'path')].name
    then:
      function: pattern
      functionOptions:
        match: ^[a-z][a-z0-9]*(-[a-z0-9]+)*$
    tags:
    - format:openapi
    - spec:parameters
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''path-parameter-kebab-case''
      (Path Parameter Kebab Case). Requirement: Path parameters MUST follow kebab-case. To fix: Ensure the targeted value
      matches the regular expression `^[a-z][a-z0-9]*(-[a-z0-9]+)*$`; rewrite any value that does not. This rule is evaluated
      at the JSONPath `$..parameters[?(@.in == ''path'')].name` — inspect every location it matches and correct only what
      violates the rule. Make the smallest change that satisfies the rule, leave all unrelated content, key order, comments,
      and formatting unchanged, and keep the document valid OpenAPI. Return only the complete corrected document, with no
      commentary.'
  openapi-path-parameter-pascal-case:
    title: Path Parameter Pascal Case
    reference: https://spotlight-rules.com/spec/rules/openapi/path-parameter-pascal-case/
    description: Path parameters MUST follow PascalCase.
    message: '{{property}} path parameter is not PascalCase: {{error}}'
    severity: info
    given: $..parameters[?(@.in == 'path')].name
    then:
      function: pattern
      functionOptions:
        match: ^[A-Z][a-zA-Z0-9]+$
    tags:
    - format:openapi
    - spec:parameters
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''path-parameter-pascal-case''
      (Path Parameter Pascal Case). Requirement: Path parameters MUST follow PascalCase. To fix: Ensure the targeted value
      matches the regular expression `^[A-Z][a-zA-Z0-9]+$`; rewrite any value that does not. This rule is evaluated at the
      JSONPath `$..parameters[?(@.in == ''path'')].name` — inspect every location it matches and correct only what violates
      the rule. Make the smallest change that satisfies the rule, leave all unrelated content, key order, comments, and formatting
      unchanged, and keep the document valid OpenAPI. Return only the complete corrected document, with no commentary.'
  openapi-path-parameter-snake-case:
    title: Path Parameter Snake Case
    reference: https://spotlight-rules.com/spec/rules/openapi/path-parameter-snake-case/
    description: Path parameters MUST follow snake_case.
    message: '{{property}} path parameter is not snake_case: {{error}}'
    severity: info
    given: $..parameters[?(@.in == 'path')].name
    then:
      function: pattern
      functionOptions:
        match: ^[a-z][a-z0-9]*(_[a-z0-9]+)*$
    tags:
    - format:openapi
    - spec:parameters
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''path-parameter-snake-case''
      (Path Parameter Snake Case). Requirement: Path parameters MUST follow snake_case. To fix: Ensure the targeted value
      matches the regular expression `^[a-z][a-z0-9]*(_[a-z0-9]+)*$`; rewrite any value that does not. This rule is evaluated
      at the JSONPath `$..parameters[?(@.in == ''path'')].name` — inspect every location it matches and correct only what
      violates the rule. Make the smallest change that satisfies the rule, leave all unrelated content, key order, comments,
      and formatting unchanged, and keep the document valid OpenAPI. Return only the complete corrected document, with no
      commentary.'
  openapi-path-resources-plural:
    title: Path Resources Plural
    reference: https://spotlight-rules.com/spec/rules/openapi/path-resources-plural/
    description: Resource names in paths should use plural nouns to maintain consistency and follow REST conventions for collection-oriented
      resource design.
    message: Path Resources Should Be Plural
    severity: info
    given: $.paths
    then:
      function: pattern
      functionOptions:
        match: ^(/[a-z].*s(/\{[^}]+\})?)*$
    tags:
    - format:openapi
    - spec:paths
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''path-resources-plural'' (Path
      Resources Plural). Requirement: Resource names in paths should use plural nouns to maintain consistency and follow REST
      conventions for collection-oriented resource design. To fix: Ensure the targeted value matches the regular expression
      `^(/[a-z].*s(/\{[^}]+\})?)*$`; rewrite any value that does not. This rule is evaluated at the JSONPath `$.paths` — inspect
      every location it matches and correct only what violates the rule. Make the smallest change that satisfies the rule,
      leave all unrelated content, key order, comments, and formatting unchanged, and keep the document valid OpenAPI. Return
      only the complete corrected document, with no commentary.'
  openapi-path-segment-kebab-case:
    title: Path Segment Kebab Case
    reference: https://spotlight-rules.com/spec/rules/openapi/path-segment-kebab-case/
    description: All YAML/JSON paths MUST follow kebab-case.
    message: '{{property}} is not kebab-case: {{error}}'
    severity: info
    given: $.paths[*]~
    then:
      function: pattern
      functionOptions:
        match: ^/([a-z0-9]+(-[a-z0-9]+)*)?(/[a-z0-9]+(-[a-z0-9]+)*|/{.+})*$
    tags:
    - format:openapi
    - spec:paths
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''path-segment-kebab-case''
      (Path Segment Kebab Case). Requirement: All YAML/JSON paths MUST follow kebab-case. To fix: Ensure the targeted value
      matches the regular expression `^/([a-z0-9]+(-[a-z0-9]+)*)?(/[a-z0-9]+(-[a-z0-9]+)*|/{.+})*$`; rewrite any value that
      does not. This rule is evaluated at the JSONPath `$.paths[*]~` — inspect every location it matches and correct only
      what violates the rule. Make the smallest change that satisfies the rule, leave all unrelated content, key order, comments,
      and formatting unchanged, and keep the document valid OpenAPI. Return only the complete corrected document, with no
      commentary.'
  openapi-path-use-standard-http-methods:
    title: Path Use Standard HTTP Methods
    reference: https://spotlight-rules.com/spec/rules/openapi/path-use-standard-http-methods/
    description: Operations MUST use only the common HTTP methods as outlined in the standards guide, and must be in lower-case.
    message: Operations MUST use only the common HTTP methods as outlined in the standards guide, and must be in lower-case.
    severity: info
    given: $.paths[*].*~
    then:
      field: method
      function: enumeration
      functionOptions:
        values:
        - get
        - post
        - put
        - patch
        - delete
        - head
        - options
    tags:
    - format:openapi
    - spec:paths
    - experience:consistency
    - experience:naming
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''path-use-standard-http-methods''
      (Path Use Standard HTTP Methods). Requirement: Operations MUST use only the common HTTP methods as outlined in the standards
      guide, and must be in lower-case. To fix: Set `method` to one of the allowed values: get, post, put, patch, delete,
      head, options. This rule is evaluated at the JSONPath `$.paths[*].*~` — inspect every location it matches and correct
      only what violates the rule. Make the smallest change that satisfies the rule, leave all unrelated content, key order,
      comments, and formatting unchanged, and keep the document valid OpenAPI. Return only the complete corrected document,
      with no commentary.'
  openapi-request-header-names-pascal-case:
    title: Request Header Names Pascal Case
    reference: https://spotlight-rules.com/spec/rules/openapi/request-header-names-pascal-case/
    description: Headers should be pascal-case. See Italian recommendation RAC_REST_NAME_003.
    message: '{{value}} {{error}} in {{path}}'
    severity: info
    given:
    - $.[parameters][?(@.in=="header")].name
    then:
      function: casing
      functionOptions:
        type: pascal
        separator:
          char: '-'
    tags:
    - format:openapi
    - spec:parameters
    - spec:headers
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''request-header-names-pascal-case''
      (Request Header Names Pascal Case). Requirement: Headers should be pascal-case. See Italian recommendation RAC_REST_NAME_003.
      To fix: Rename the targeted key or value to PascalCase (e.g. `UserName`) at each matching location, updating every reference
      to it. This rule is evaluated at the JSONPath `$.[parameters][?(@.in=="header")].name` — inspect every location it matches
      and correct only what violates the rule. Make the smallest change that satisfies the rule, leave all unrelated content,
      key order, comments, and formatting unchanged, and keep the document valid OpenAPI. Return only the complete corrected
      document, with no commentary.'
  openapi-request-property-names-camel-case:
    title: Request Property Names Camel Case
    reference: https://spotlight-rules.com/spec/rules/openapi/request-property-names-camel-case/
    description: MUST property names must be ASCII camelCase [118a].
    message: Property name has to be ASCII camelCase
    severity: info
    given: $.paths.*.*[responses,requestBody]..content..schema..properties.*~
    then:
      function: pattern
      functionOptions:
        match: ^[a-z]+((\d)|([A-Z0-9][a-z0-9]+))*([A-Z])?$
    tags:
    - format:openapi
    - spec:paths
    - spec:request-body
    - spec:responses
    - spec:media-types
    - spec:schemas
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''request-property-names-camel-case''
      (Request Property Names Camel Case). Requirement: MUST property names must be ASCII camelCase [118a]. To fix: Ensure
      the targeted value matches the regular expression `^[a-z]+((\d)|([A-Z0-9][a-z0-9]+))*([A-Z])?$`; rewrite any value that
      does not. This rule is evaluated at the JSONPath `$.paths.*.*[responses,requestBody]..content..schema..properties.*~`
      — inspect every location it matches and correct only what violates the rule. Make the smallest change that satisfies
      the rule, leave all unrelated content, key order, comments, and formatting unchanged, and keep the document valid OpenAPI.
      Return only the complete corrected document, with no commentary.'
  openapi-response-custom-header-naming-format:
    title: Response Custom Header Naming Format
    reference: https://spotlight-rules.com/spec/rules/openapi/response-custom-header-naming-format/
    description: Custom headers MUST NOT be longer than 50 chars, and MUST only contain alphanumeric and dash chars, and MUST
      begin with Sps- not X-.
    message: Custom headers MUST NOT be longer than 50 chars, and MUST only contain alphanumeric and dash chars, and MUST
      begin with Sps- not X-.
    severity: info
    given: $.paths[*][*].responses[*].headers.*~
    then:
      function: pattern
      functionOptions:
        match: ^(Sps-[a-zA-Z0-9-]{1,50}|Accept|Access-Control.*|Authorization|Cache-Control|Content-Disposition|Content-Language|Content-Length|Content-Type|Date|ETag|Host|If-Match|If-None-Match|Location|Origin|User-Agent)$
    tags:
    - format:openapi
    - spec:paths
    - spec:responses
    - spec:headers
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''response-custom-header-naming-format''
      (Response Custom Header Naming Format). Requirement: Custom headers MUST NOT be longer than 50 chars, and MUST only
      contain alphanumeric and dash chars, and MUST begin with Sps- not X-. To fix: Ensure the targeted value matches the
      regular expression `^(Sps-[a-zA-Z0-9-]{1,50}|Accept|Access-Control.*|Authorization|Cache-Control|Content-Disposition|Content-Language|Content-Length|Content-Type|Date|ETag|Host|If-Match|If-None-Match|Location|Origin|User-Agent)$`;
      rewrite any value that does not. This rule is evaluated at the JSONPath `$.paths[*][*].responses[*].headers.*~` — inspect
      every location it matches and correct only what violates the rule. Make the smallest change that satisfies the rule,
      leave all unrelated content, key order, comments, and formatting unchanged, and keep the document valid OpenAPI. Return
      only the complete corrected document, with no commentary.'
  openapi-response-header-names-pascal-case:
    title: Response Header Names Pascal Case
    reference: https://spotlight-rules.com/spec/rules/openapi/response-header-names-pascal-case/
    description: Headers should be pascal-case. See Italian recommendation RAC_REST_NAME_003.
    message: 'Header {{error}}: {{path}}'
    severity: info
    given:
    - $.[responses][*].headers.*~
    then:
      function: casing
      functionOptions:
        type: pascal
        separator:
          char: '-'
    tags:
    - format:openapi
    - spec:responses
    - spec:headers
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''response-header-names-pascal-case''
      (Response Header Names Pascal Case). Requirement: Headers should be pascal-case. See Italian recommendation RAC_REST_NAME_003.
      To fix: Rename the targeted key or value to PascalCase (e.g. `UserName`) at each matching location, updating every reference
      to it. This rule is evaluated at the JSONPath `$.[responses][*].headers.*~` — inspect every location it matches and
      correct only what violates the rule. Make the smallest change that satisfies the rule, leave all unrelated content,
      key order, comments, and formatting unchanged, and keep the document valid OpenAPI. Return only the complete corrected
      document, with no commentary.'
  openapi-response-header-no-x-prefix:
    title: Response Header No X Prefix
    reference: https://spotlight-rules.com/spec/rules/openapi/response-header-no-x-prefix/
    description: '''HTTP'' headers SHOULD NOT start with ''X-'' RFC6648.'
    message: HTTP response header SHOULD NOT start with 'X-' in {{path}}
    severity: info
    given:
    - $.[responses][*].headers.*~
    then:
      function: pattern
      functionOptions:
        match: /^([^x]|.[^-])|RateLimit-/i
    tags:
    - format:openapi
    - spec:responses
    - spec:headers
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''response-header-no-x-prefix''
      (Response Header No X Prefix). Requirement: ''HTTP'' headers SHOULD NOT start with ''X-'' RFC6648. To fix: Ensure the
      targeted value matches the regular expression `/^([^x]|.[^-])|RateLimit-/i`; rewrite any value that does not. This rule
      is evaluated at the JSONPath `$.[responses][*].headers.*~` — inspect every location it matches and correct only what
      violates the rule. Make the smallest change that satisfies the rule, leave all unrelated content, key order, comments,
      and formatting unchanged, and keep the document valid OpenAPI. Return only the complete corrected document, with no
      commentary.'
  openapi-response-keys-snake-case:
    title: Response Keys Snake Case
    reference: https://spotlight-rules.com/spec/rules/openapi/response-keys-snake-case/
    description: response key must be snake cased (e.g. snake_case).
    message: '{{error}}'
    severity: info
    given: $.components['responses'].*~
    then:
      function: digitalocean-ensureSnakeCaseWithDigits
    tags:
    - format:openapi
    - spec:responses
    - spec:components
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''response-keys-snake-case''
      (Response Keys Snake Case). Requirement: response key must be snake cased (e.g. snake_case). This rule is evaluated
      at the JSONPath `$.components[''responses''].*~` — inspect every location it matches and correct only what violates
      the rule. Make the smallest change that satisfies the rule, leave all unrelated content, key order, comments, and formatting
      unchanged, and keep the document valid OpenAPI. Return only the complete corrected document, with no commentary.'
  openapi-response-names-pascal-case:
    title: Response Names Pascal Case
    reference: https://spotlight-rules.com/spec/rules/openapi/response-names-pascal-case/
    description: Response names SHOULD be written in PascalCase.
    message: '{{property}} is not PascalCase: {{error}}'
    severity: info
    given: $.components.responses.*~
    then:
      function: pattern
      functionOptions:
        match: ^[A-Z][a-zA-Z0-9]*$
    tags:
    - format:openapi
    - spec:responses
    - spec:components
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''response-names-pascal-case''
      (Response Names Pascal Case). Requirement: Response names SHOULD be written in PascalCase. To fix: Ensure the targeted
      value matches the regular expression `^[A-Z][a-zA-Z0-9]*$`; rewrite any value that does not. This rule is evaluated
      at the JSONPath `$.components.responses.*~` — inspect every location it matches and correct only what violates the rule.
      Make the smallest change that satisfies the rule, leave all unrelated content, key order, comments, and formatting unchanged,
      and keep the document valid OpenAPI. Return only the complete corrected document, with no commentary.'
  openapi-schema-boolean-no-prefix:
    title: Schema Boolean No Prefix
    reference: https://spotlight-rules.com/spec/rules/openapi/schema-boolean-no-prefix/
    description: Boolean properties SHOULD NOT use is, has, or another prefix.
    message: Boolean properties SHOULD NOT use is, has, or another prefix.
    severity: info
    given: $..properties[?(@ && @.type == 'boolean')]~
    then:
      function: pattern
      functionOptions:
        notMatch: ^(is|has|was|will|needs|uses|should|can)([A-Z]|$).*
    formats:
    - oas3
    tags:
    - format:openapi
    - spec:schemas
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''schema-boolean-no-prefix''
      (Schema Boolean No Prefix). Requirement: Boolean properties SHOULD NOT use is, has, or another prefix. To fix: Ensure
      the targeted value does NOT match the regular expression `^(is|has|was|will|needs|uses|should|can)([A-Z]|$).*`; rename
      or rewrite any value that does. This rule is evaluated at the JSONPath `$..properties[?(@ && @.type == ''boolean'')]~`
      — inspect every location it matches and correct only what violates the rule. Make the smallest change that satisfies
      the rule, leave all unrelated content, key order, comments, and formatting unchanged, and keep the document valid OpenAPI.
      Return only the complete corrected document, with no commentary.'
  openapi-schema-definition-camel-case:
    title: Schema Definition Camel Case
    reference: https://spotlight-rules.com/spec/rules/openapi/schema-definition-camel-case/
    description: Schema definitions MUST follow camelCase.
    message: '{{property}} schema definition is not camelCase: {{error}}'
    severity: info
    given: $.definitions[*]~
    then:
      function: pattern
      functionOptions:
        match: ^[a-z][a-zA-Z0-9]*$
    tags:
    - format:openapi
    - spec:schemas
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''schema-definition-camel-case''
      (Schema Definition Camel Case). Requirement: Schema definitions MUST follow camelCase. To fix: Ensure the targeted value
      matches the regular expression `^[a-z][a-zA-Z0-9]*$`; rewrite any value that does not. This rule is evaluated at the
      JSONPath `$.definitions[*]~` — inspect every location it matches and correct only what violates the rule. Make the smallest
      change that satisfies the rule, leave all unrelated content, key order, comments, and formatting unchanged, and keep
      the document valid OpenAPI. Return only the complete corrected document, with no commentary.'
  openapi-schema-definition-constant-case:
    title: Schema Definition Constant Case
    reference: https://spotlight-rules.com/spec/rules/openapi/schema-definition-constant-case/
    description: Schema definitions MUST follow CONSTANT_CASE (screaming snake_case).
    message: '{{property}} schema definition is not CONSTANT_CASE: {{error}}'
    severity: info
    given: $.definitions[*]~
    then:
      function: pattern
      functionOptions:
        match: ^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$
    tags:
    - format:openapi
    - spec:schemas
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''schema-definition-constant-case''
      (Schema Definition Constant Case). Requirement: Schema definitions MUST follow CONSTANT_CASE (screaming snake_case).
      To fix: Ensure the targeted value matches the regular expression `^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$`; rewrite any value
      that does not. This rule is evaluated at the JSONPath `$.definitions[*]~` — inspect every location it matches and correct
      only what violates the rule. Make the smallest change that satisfies the rule, leave all unrelated content, key order,
      comments, and formatting unchanged, and keep the document valid OpenAPI. Return only the complete corrected document,
      with no commentary.'
  openapi-schema-definition-kebab-case:
    title: Schema Definition Kebab Case
    reference: https://spotlight-rules.com/spec/rules/openapi/schema-definition-kebab-case/
    description: Schema definitions MUST follow kebab-case.
    message: '{{property}} schema definition is not kebab-case: {{error}}'
    severity: info
    given: $.definitions[*]~
    then:
      function: pattern
      functionOptions:
        match: ^[a-z][a-z0-9]*(-[a-z0-9]+)*$
    tags:
    - format:openapi
    - spec:schemas
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''schema-definition-kebab-case''
      (Schema Definition Kebab Case). Requirement: Schema definitions MUST follow kebab-case. To fix: Ensure the targeted
      value matches the regular expression `^[a-z][a-z0-9]*(-[a-z0-9]+)*$`; rewrite any value that does not. This rule is
      evaluated at the JSONPath `$.definitions[*]~` — inspect every location it matches and correct only what violates the
      rule. Make the smallest change that satisfies the rule, leave all unrelated content, key order, comments, and formatting
      unchanged, and keep the document valid OpenAPI. Return only the complete corrected document, with no commentary.'
  openapi-schema-definition-pascal-case:
    title: Schema Definition Pascal Case
    reference: https://spotlight-rules.com/spec/rules/openapi/schema-definition-pascal-case/
    description: Schema definitions MUST follow PascalCase.
    message: '{{property}} schema definition is not PascalCase: {{error}}'
    severity: info
    given: $.definitions[*]~
    then:
      function: pattern
      functionOptions:
        match: ^[A-Z][a-zA-Z0-9]*$
    tags:
    - format:openapi
    - spec:schemas
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''schema-definition-pascal-case''
      (Schema Definition Pascal Case). Requirement: Schema definitions MUST follow PascalCase. To fix: Ensure the targeted
      value matches the regular expression `^[A-Z][a-zA-Z0-9]*$`; rewrite any value that does not. This rule is evaluated
      at the JSONPath `$.definitions[*]~` — inspect every location it matches and correct only what violates the rule. Make
      the smallest change that satisfies the rule, leave all unrelated content, key order, comments, and formatting unchanged,
      and keep the document valid OpenAPI. Return only the complete corrected document, with no commentary.'
  openapi-schema-definition-snake-case:
    title: Schema Definition Snake Case
    reference: https://spotlight-rules.com/spec/rules/openapi/schema-definition-snake-case/
    description: Schema definitions MUST follow snake_case.
    message: '{{property}} schema definition is not snake_case: {{error}}'
    severity: info
    given: $.definitions[*]~
    then:
      function: pattern
      functionOptions:
        match: ^[a-z][a-z0-9]*(_[a-z0-9]+)*$
    tags:
    - format:openapi
    - spec:schemas
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''schema-definition-snake-case''
      (Schema Definition Snake Case). Requirement: Schema definitions MUST follow snake_case. To fix: Ensure the targeted
      value matches the regular expression `^[a-z][a-z0-9]*(_[a-z0-9]+)*$`; rewrite any value that does not. This rule is
      evaluated at the JSONPath `$.definitions[*]~` — inspect every location it matches and correct only what violates the
      rule. Make the smallest change that satisfies the rule, leave all unrelated content, key order, comments, and formatting
      unchanged, and keep the document valid OpenAPI. Return only the complete corrected document, with no commentary.'
  openapi-schema-keys-snake-case:
    title: Schema Keys Snake Case
    reference: https://spotlight-rules.com/spec/rules/openapi/schema-keys-snake-case/
    description: schema key must be snake cased (e.g. snake_case).
    message: '{{error}}'
    severity: info
    given: $.components['schemas'].*~
    then:
      function: digitalocean-ensureSnakeCaseWithDigits
    tags:
    - format:openapi
    - spec:schemas
    - spec:components
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''schema-keys-snake-case'' (Schema
      Keys Snake Case). Requirement: schema key must be snake cased (e.g. snake_case). This rule is evaluated at the JSONPath
      `$.components[''schemas''].*~` — inspect every location it matches and correct only what violates the rule. Make the
      smallest change that satisfies the rule, leave all unrelated content, key order, comments, and formatting unchanged,
      and keep the document valid OpenAPI. Return only the complete corrected document, with no commentary.'
  openapi-schema-name-max-length:
    title: Schema Name Max Length
    reference: https://spotlight-rules.com/spec/rules/openapi/schema-name-max-length/
    description: Schema should have a length limit applied keeping the names of schema consistent across APIs.
    message: Schema Names MUST Be Less Than 25 Characters
    severity: info
    given: $.components.schemas
    then:
      field: '@key'
      function: length
      functionOptions:
        max: 25
    tags:
    - format:openapi
    - spec:schemas
    - spec:components
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''schema-name-max-length'' (Schema
      Name Max Length). Requirement: Schema should have a length limit applied keeping the names of schema consistent across
      APIs. To fix: Ensure the length of `@key` is at most 25. This rule is evaluated at the JSONPath `$.components.schemas`
      — inspect every location it matches and correct only what violates the rule. Make the smallest change that satisfies
      the rule, leave all unrelated content, key order, comments, and formatting unchanged, and keep the document valid OpenAPI.
      Return only the complete corrected document, with no commentary.'
  openapi-schema-names-pascal-case:
    title: Schema Names Pascal Case
    reference: https://spotlight-rules.com/spec/rules/openapi/schema-names-pascal-case/
    description: Schema names SHOULD be written in PascalCase.
    message: '{{property}} is not PascalCase: {{error}}'
    severity: info
    given: $.components.schemas.*~
    then:
      function: pattern
      functionOptions:
        match: ^[A-Z][a-zA-Z0-9]*$
    tags:
    - format:openapi
    - spec:schemas
    - spec:components
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''schema-names-pascal-case''
      (Schema Names Pascal Case). Requirement: Schema names SHOULD be written in PascalCase. To fix: Ensure the targeted value
      matches the regular expression `^[A-Z][a-zA-Z0-9]*$`; rewrite any value that does not. This rule is evaluated at the
      JSONPath `$.components.schemas.*~` — inspect every location it matches and correct only what violates the rule. Make
      the smallest change that satisfies the rule, leave all unrelated content, key order, comments, and formatting unchanged,
      and keep the document valid OpenAPI. Return only the complete corrected document, with no commentary.'
  openapi-schema-property-camel-case:
    title: Schema Property Camel Case
    reference: https://spotlight-rules.com/spec/rules/openapi/schema-property-camel-case/
    description: Schema properties MUST follow camelCase.
    message: '{{property}} schema property is not camelCase: {{error}}'
    severity: info
    given: $.definitions..properties[*]~
    then:
      function: pattern
      functionOptions:
        match: ^[a-z][a-zA-Z0-9]*$
    tags:
    - format:openapi
    - spec:schemas
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''schema-property-camel-case''
      (Schema Property Camel Case). Requirement: Schema properties MUST follow camelCase. To fix: Ensure the targeted value
      matches the regular expression `^[a-z][a-zA-Z0-9]*$`; rewrite any value that does not. This rule is evaluated at the
      JSONPath `$.definitions..properties[*]~` — inspect every location it matches and correct only what violates the rule.
      Make the smallest change that satisfies the rule, leave all unrelated content, key order, comments, and formatting unchanged,
      and keep the document valid OpenAPI. Return only the complete corrected document, with no commentary.'
  openapi-schema-property-camel-case-3:
    title: Schema Property Camel Case 3
    reference: https://spotlight-rules.com/spec/rules/openapi/schema-property-camel-case-3/
    description: Schema property names should use camelCase. Analysis of 773 specs shows camelCase is the dominant convention
      at 65% (12958 properties), followed by snake_case at 33% (6661 properties).
    message: Schema Properties MUST Use camelCase
    severity: info
    given: $.components.schemas[*].properties
    then:
      function: pattern
      functionOptions:
        match: ^[a-z][a-zA-Z0-9]*$
    tags:
    - format:openapi
    - spec:schemas
    - spec:components
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''schema-property-camel-case-3''
      (Schema Property Camel Case 3). Requirement: Schema property names should use camelCase. Analysis of 773 specs shows
      camelCase is the dominant convention at 65% (12958 properties), followed by snake_case at 33% (6661 properties). To
      fix: Ensure the targeted value matches the regular expression `^[a-z][a-zA-Z0-9]*$`; rewrite any value that does not.
      This rule is evaluated at the JSONPath `$.components.schemas[*].properties` — inspect every location it matches and
      correct only what violates the rule. Make the smallest change that satisfies the rule, leave all unrelated content,
      key order, comments, and formatting unchanged, and keep the document valid OpenAPI. Return only the complete corrected
      document, with no commentary.'
  openapi-schema-property-constant-case:
    title: Schema Property Constant Case
    reference: https://spotlight-rules.com/spec/rules/openapi/schema-property-constant-case/
    description: Schema properties MUST follow CONSTANT_CASE (screaming snake_case).
    message: '{{property}} schema property is not CONSTANT_CASE: {{error}}'
    severity: info
    given: $.definitions..properties[*]~
    then:
      function: pattern
      functionOptions:
        match: ^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$
    tags:
    - format:openapi
    - spec:schemas
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''schema-property-constant-case''
      (Schema Property Constant Case). Requirement: Schema properties MUST follow CONSTANT_CASE (screaming snake_case). To
      fix: Ensure the targeted value matches the regular expression `^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$`; rewrite any value that
      does not. This rule is evaluated at the JSONPath `$.definitions..properties[*]~` — inspect every location it matches
      and correct only what violates the rule. Make the smallest change that satisfies the rule, leave all unrelated content,
      key order, comments, and formatting unchanged, and keep the document valid OpenAPI. Return only the complete corrected
      document, with no commentary.'
  openapi-schema-property-enum-upper-snake-case:
    title: Schema Property Enum Upper Snake Case
    reference: https://spotlight-rules.com/spec/rules/openapi/schema-property-enum-upper-snake-case/
    description: Schema property enumerators are consistent casing, keeping all entries upper snake case, and consistent across
      all APIs.
    message: Schema Property Enum MUST Be Upper Snake Case
    severity: info
    given: $.components.schemas.*.properties.*.enum.*
    then:
      function: pattern
      functionOptions:
        match: ^[A-Z]+(?:_[A-Z]+)*$
    tags:
    - format:openapi
    - spec:schemas
    - spec:components
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''schema-property-enum-upper-snake-case''
      (Schema Property Enum Upper Snake Case). Requirement: Schema property enumerators are consistent casing, keeping all
      entries upper snake case, and consistent across all APIs. To fix: Ensure the targeted value matches the regular expression
      `^[A-Z]+(?:_[A-Z]+)*$`; rewrite any value that does not. This rule is evaluated at the JSONPath `$.components.schemas.*.properties.*.enum.*`
      — inspect every location it matches and correct only what violates the rule. Make the smallest change that satisfies
      the rule, leave all unrelated content, key order, comments, and formatting unchanged, and keep the document valid OpenAPI.
      Return only the complete corrected document, with no commentary.'
  openapi-schema-property-kebab-case:
    title: Schema Property Kebab Case
    reference: https://spotlight-rules.com/spec/rules/openapi/schema-property-kebab-case/
    description: Schema properties MUST follow kebab-case.
    message: '{{property}} schema property is not kebab-case: {{error}}'
    severity: info
    given: $.definitions..properties[*]~
    then:
      function: pattern
      functionOptions:
        match: ^[a-z][a-z0-9]*(-[a-z0-9]+)*$
    tags:
    - format:openapi
    - spec:schemas
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''schema-property-kebab-case''
      (Schema Property Kebab Case). Requirement: Schema properties MUST follow kebab-case. To fix: Ensure the targeted value
      matches the regular expression `^[a-z][a-z0-9]*(-[a-z0-9]+)*$`; rewrite any value that does not. This rule is evaluated
      at the JSONPath `$.definitions..properties[*]~` — inspect every location it matches and correct only what violates the
      rule. Make the smallest change that satisfies the rule, leave all unrelated content, key order, comments, and formatting
      unchanged, and keep the document valid OpenAPI. Return only the complete corrected document, with no commentary.'
  openapi-schema-property-names-camel-case:
    title: Schema Property Names Camel Case
    reference: https://spotlight-rules.com/spec/rules/openapi/schema-property-names-camel-case/
    description: Schema property names are camel case, providing consistent casing across all the schema properties used by
      APIs.
    message: Schema Property Names MUST Be camelCase.
    severity: info
    given: $.components.schemas.*.properties
    then:
    - field: '@key'
      function: pattern
      functionOptions:
        notMatch: ^[A-Z][a-z0-9]*[A-Z0-9][a-z0-9]+[A-Za-z0-9]*$
    tags:
    - format:openapi
    - spec:schemas
    - spec:components
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''schema-property-names-camel-case''
      (Schema Property Names Camel Case). Requirement: Schema property names are camel case, providing consistent casing across
      all the schema properties used by APIs. To fix: Ensure `@key` does NOT match the regular expression `^[A-Z][a-z0-9]*[A-Z0-9][a-z0-9]+[A-Za-z0-9]*$`;
      rename or rewrite any value that does. This rule is evaluated at the JSONPath `$.components.schemas.*.properties` —
      inspect every location it matches and correct only what violates the rule. Make the smallest change that satisfies the
      rule, leave all unrelated content, key order, comments, and formatting unchanged, and keep the document valid OpenAPI.
      Return only the complete corrected document, with no commentary.'
  openapi-schema-property-names-camel-case-2:
    title: Schema Property Names Camel Case 2
    reference: https://spotlight-rules.com/spec/rules/openapi/schema-property-names-camel-case-2/
    description: Property names and acronyms MUST be in camelCase.
    message: Property names and acronyms MUST be in camelCase.
    severity: info
    given: $..properties.*~
    then:
      function: pattern
      functionOptions:
        match: ^[a-z][a-z0-9]*(([A-Z]{2}|[A-Z])[a-z0-9]+)*$
    formats:
    - oas3
    tags:
    - format:openapi
    - spec:schemas
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''schema-property-names-camel-case-2''
      (Schema Property Names Camel Case 2). Requirement: Property names and acronyms MUST be in camelCase. To fix: Ensure
      the targeted value matches the regular expression `^[a-z][a-z0-9]*(([A-Z]{2}|[A-Z])[a-z0-9]+)*$`; rewrite any value
      that does not. This rule is evaluated at the JSONPath `$..properties.*~` — inspect every location it matches and correct
      only what violates the rule. Make the smallest change that satisfies the rule, leave all unrelated content, key order,
      comments, and formatting unchanged, and keep the document valid OpenAPI. Return only the complete corrected document,
      with no commentary.'
  openapi-schema-property-names-length-limit:
    title: Schema Property Names Length Limit
    reference: https://spotlight-rules.com/spec/rules/openapi/schema-property-names-length-limit/
    description: Schema property names have a length restriction applied, keeping names consistent, and avoiding being too
      long.
    message: Schema Properties Name Length
    severity: info
    given: $.components.schemas.*.properties
    then:
      field: '@key'
      function: length
      functionOptions:
        max: 25
    tags:
    - format:openapi
    - spec:schemas
    - spec:components
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''schema-property-names-length-limit''
      (Schema Property Names Length Limit). Requirement: Schema property names have a length restriction applied, keeping
      names consistent, and avoiding being too long. To fix: Ensure the length of `@key` is at most 25. This rule is evaluated
      at the JSONPath `$.components.schemas.*.properties` — inspect every location it matches and correct only what violates
      the rule. Make the smallest change that satisfies the rule, leave all unrelated content, key order, comments, and formatting
      unchanged, and keep the document valid OpenAPI. Return only the complete corrected document, with no commentary.'
  openapi-schema-property-no-language-keywords:
    title: Schema Property No Language Keywords
    reference: https://spotlight-rules.com/spec/rules/openapi/schema-property-no-language-keywords/
    description: Names that may conflict with keywords in common programming languages SHOULD NOT be used.
    message: Names that may conflict with keywords in common programming languages SHOULD NOT be used.
    severity: info
    given: $..properties.*~
    then:
      function: pattern
      functionOptions:
        notMatch: ^(abstract|for|new|switch|assert|default|goto|package|synchronized|boolean|do|if|private|this|break|double|implements|throw|byte|else|import|public|throws|case|enum|instanceof|return|transient|catch|extends|int|short|try|char|final|interface|static|void|class|finally|long|volatile|const|float|native|super|while)$
    tags:
    - format:openapi
    - spec:schemas
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''schema-property-no-language-keywords''
      (Schema Property No Language Keywords). Requirement: Names that may conflict with keywords in common programming languages
      SHOULD NOT be used. To fix: Ensure the targeted value does NOT match the regular expression `^(abstract|for|new|switch|assert|default|goto|package|synchronized|boolean|do|if|private|this|break|double|implements|throw|byte|else|import|public|throws|case|enum|instanceof|return|transient|catch|extends|int|short|try|char|final|interface|static|void|class|finally|long|volatile|const|float|native|super|while)$`;
      rename or rewrite any value that does. This rule is evaluated at the JSONPath `$..properties.*~` — inspect every location
      it matches and correct only what violates the rule. Make the smallest change that satisfies the rule, leave all unrelated
      content, key order, comments, and formatting unchanged, and keep the document valid OpenAPI. Return only the complete
      corrected document, with no commentary.'
  openapi-schema-property-no-prepositions:
    title: Schema Property No Prepositions
    reference: https://spotlight-rules.com/spec/rules/openapi/schema-property-no-prepositions/
    description: Property names SHOULD NOT include prepositions (e.g. "for", "during", "at", etc.).
    message: Property names SHOULD NOT include prepositions (e.g.
    severity: info
    given: $..properties.*~
    then:
      function: pattern
      functionOptions:
        notMatch: (^(about|above|across|after|against|among|around|at|before|behind|below|beside|between|down|during|for|from|in|inside|into|near|of|off|on|out|over|through|to|toward|under|up|with|as|but|like|since|than|till|unlike|until|upon|within|without)([A-Z]|$)|.*(About|Above|Across|After|Against|Among|Around|At|Before|Behind|Below|Beside|Between|Down|During|For|From|In|Inside|Into|Near|Of|Off|On|Out|Over|Through|To|Toward|Under|Up|With|As|But|Like|Since|Than|Till|Unlike|Until|Upon|Within|Without)([A-Z]|$)).*
    formats:
    - oas3
    tags:
    - format:openapi
    - spec:schemas
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''schema-property-no-prepositions''
      (Schema Property No Prepositions). Requirement: Property names SHOULD NOT include prepositions (e.g. "for", "during",
      "at", etc.). To fix: Ensure the targeted value does NOT match the regular expression `(^(about|above|across|after|against|among|around|at|before|behind|below|beside|between|down|during|for|from|in|inside|into|near|of|off|on|out|over|through|to|toward|under|up|with|as|but|like|since|than|till|unlike|until|upon|within|without)([A-Z]|$)|.*(About|Above|Across|After|Against|Among|Around|At|Before|Behind|Below|Beside|Between|Down|During|For|From|In|Inside|Into|Near|Of|Off|On|Out|Over|Through|To|Toward|Under|Up|With|As|But|Like|Since|Than|Till|Unlike|Until|Upon|Within|Without)([A-Z]|$)).*`;
      rename or rewrite any value that does. This rule is evaluated at the JSONPath `$..properties.*~` — inspect every location
      it matches and correct only what violates the rule. Make the smallest change that satisfies the rule, leave all unrelated
      content, key order, comments, and formatting unchanged, and keep the document valid OpenAPI. Return only the complete
      corrected document, with no commentary.'
  openapi-schema-property-pascal-case:
    title: Schema Property Pascal Case
    reference: https://spotlight-rules.com/spec/rules/openapi/schema-property-pascal-case/
    description: Schema properties MUST follow PascalCase.
    message: '{{property}} schema property is not PascalCase: {{error}}'
    severity: info
    given: $.definitions..properties[*]~
    then:
      function: pattern
      functionOptions:
        match: ^[A-Z][a-zA-Z0-9]*$
    tags:
    - format:openapi
    - spec:schemas
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''schema-property-pascal-case''
      (Schema Property Pascal Case). Requirement: Schema properties MUST follow PascalCase. To fix: Ensure the targeted value
      matches the regular expression `^[A-Z][a-zA-Z0-9]*$`; rewrite any value that does not. This rule is evaluated at the
      JSONPath `$.definitions..properties[*]~` — inspect every location it matches and correct only what violates the rule.
      Make the smallest change that satisfies the rule, leave all unrelated content, key order, comments, and formatting unchanged,
      and keep the document valid OpenAPI. Return only the complete corrected document, with no commentary.'
  openapi-schema-property-snake-case:
    title: Schema Property Snake Case
    reference: https://spotlight-rules.com/spec/rules/openapi/schema-property-snake-case/
    description: Schema properties MUST follow snake_case.
    message: '{{property}} schema property is not snake_case: {{error}}'
    severity: info
    given: $.definitions..properties[*]~
    then:
      function: pattern
      functionOptions:
        match: ^[a-z][a-z0-9]*(_[a-z0-9]+)*$
    tags:
    - format:openapi
    - spec:schemas
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''schema-property-snake-case''
      (Schema Property Snake Case). Requirement: Schema properties MUST follow snake_case. To fix: Ensure the targeted value
      matches the regular expression `^[a-z][a-z0-9]*(_[a-z0-9]+)*$`; rewrite any value that does not. This rule is evaluated
      at the JSONPath `$.definitions..properties[*]~` — inspect every location it matches and correct only what violates the
      rule. Make the smallest change that satisfies the rule, leave all unrelated content, key order, comments, and formatting
      unchanged, and keep the document valid OpenAPI. Return only the complete corrected document, with no commentary.'
  openapi-schema-require-name:
    title: Schema Require Name
    reference: https://spotlight-rules.com/spec/rules/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
    then:
      field: '@key'
      function: truthy
    tags:
    - format:openapi
    - spec:schemas
    - spec:components
    - experience:naming
    - experience:data-modeling
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''schema-require-name'' (Schema
      Require Name). Requirement: Schema names, keeping the naming of them consistent across APIs, standardizing how consumers
      can use in their applications. To fix: Ensure `@key` is present and non-empty at each matching location. This rule is
      evaluated at the JSONPath `$.components.schemas` — inspect every location it matches and correct only what violates
      the rule. Make the smallest change that satisfies the rule, leave all unrelated content, key order, comments, and formatting
      unchanged, and keep the document valid OpenAPI. Return only the complete corrected document, with no commentary.'
  openapi-schema-use-fingerprint-not-hash:
    title: Schema Use Fingerprint Not Hash
    reference: https://spotlight-rules.com/spec/rules/openapi/schema-use-fingerprint-not-hash/
    description: Rather than property names refering to the implementation for 'hash' or 'hashkey', you MUST use the property
      name 'fingerprint'.
    message: '{{property}} is not using property name fingerprint.'
    severity: info
    given: $.components.schemas..properties.*~
    then:
      function: pattern
      functionOptions:
        notMatch: ^hashkey|hashKey|hash$
    formats:
    - oas3
    tags:
    - format:openapi
    - spec:schemas
    - spec:components
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''schema-use-fingerprint-not-hash''
      (Schema Use Fingerprint Not Hash). Requirement: Rather than property names refering to the implementation for ''hash''
      or ''hashkey'', you MUST use the property name ''fingerprint''. To fix: Ensure the targeted value does NOT match the
      regular expression `^hashkey|hashKey|hash$`; rename or rewrite any value that does. This rule is evaluated at the JSONPath
      `$.components.schemas..properties.*~` — inspect every location it matches and correct only what violates the rule. Make
      the smallest change that satisfies the rule, leave all unrelated content, key order, comments, and formatting unchanged,
      and keep the document valid OpenAPI. Return only the complete corrected document, with no commentary.'
  openapi-schema-use-id-not-identifier:
    title: Schema Use ID Not Identifier
    reference: https://spotlight-rules.com/spec/rules/openapi/schema-use-id-not-identifier/
    description: Use abbreviations instead of long form names, i.e. identifier SHOULD BE id.
    message: Use abbreviations instead of long form names, i.e.
    severity: info
    given: $..properties.*~
    then:
      function: pattern
      functionOptions:
        notMatch: ^identifier$
    formats:
    - oas3
    tags:
    - format:openapi
    - spec:schemas
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''schema-use-id-not-identifier''
      (Schema Use ID Not Identifier). Requirement: Use abbreviations instead of long form names, i.e. identifier SHOULD BE
      id. To fix: Ensure the targeted value does NOT match the regular expression `^identifier$`; rename or rewrite any value
      that does. This rule is evaluated at the JSONPath `$..properties.*~` — inspect every location it matches and correct
      only what violates the rule. Make the smallest change that satisfies the rule, leave all unrelated content, key order,
      comments, and formatting unchanged, and keep the document valid OpenAPI. Return only the complete corrected document,
      with no commentary.'
  openapi-schema-use-org-not-organization:
    title: Schema Use Org Not Organization
    reference: https://spotlight-rules.com/spec/rules/openapi/schema-use-org-not-organization/
    description: Use abbreviations instead of long form names, i.e. organization SHOULD BE org.
    message: Use abbreviations instead of long form names, i.e.
    severity: info
    given: $..properties.*~
    then:
      function: pattern
      functionOptions:
        notMatch: (^organization([A-Z]|$)|Organization([A-Z]|$))
    formats:
    - oas3
    tags:
    - format:openapi
    - spec:schemas
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''schema-use-org-not-organization''
      (Schema Use Org Not Organization). Requirement: Use abbreviations instead of long form names, i.e. organization SHOULD
      BE org. To fix: Ensure the targeted value does NOT match the regular expression `(^organization([A-Z]|$)|Organization([A-Z]|$))`;
      rename or rewrite any value that does. This rule is evaluated at the JSONPath `$..properties.*~` — inspect every location
      it matches and correct only what violates the rule. Make the smallest change that satisfies the rule, leave all unrelated
      content, key order, comments, and formatting unchanged, and keep the document valid OpenAPI. Return only the complete
      corrected document, with no commentary.'
  openapi-server-url-must-be-lowercase:
    title: Server URL Must Be Lowercase
    reference: https://spotlight-rules.com/spec/rules/openapi/server-url-must-be-lowercase/
    description: Server URL SHOULD BE lowercase.
    message: Server URL SHOULD BE lowercase.
    severity: info
    given: $.servers..url
    then:
      function: pattern
      functionOptions:
        match: ^[^A-Z]*$
    formats:
    - oas3
    tags:
    - format:openapi
    - spec:servers
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''server-url-must-be-lowercase''
      (Server URL Must Be Lowercase). Requirement: Server URL SHOULD BE lowercase. To fix: Ensure the targeted value matches
      the regular expression `^[^A-Z]*$`; rewrite any value that does not. This rule is evaluated at the JSONPath `$.servers..url`
      — inspect every location it matches and correct only what violates the rule. Make the smallest change that satisfies
      the rule, leave all unrelated content, key order, comments, and formatting unchanged, and keep the document valid OpenAPI.
      Return only the complete corrected document, with no commentary.'
  openapi-tag-names-title-case:
    title: Tag Names Title Case
    reference: https://spotlight-rules.com/spec/rules/openapi/tag-names-title-case/
    description: The first letter of each word in a tag being applied to APIs needs to be capitalized, keeping the tags being
      applied across APIs the same look and feel for organizing and publishing to documentation.
    message: Tag Names MUST Have First Letter in Each Word Capitalized
    severity: info
    given: $.tags.*.name
    then:
      function: pattern
      functionOptions:
        match: '[A-Z]\w*'
    tags:
    - format:openapi
    - spec:tags
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''tag-names-title-case'' (Tag
      Names Title Case). Requirement: The first letter of each word in a tag being applied to APIs needs to be capitalized,
      keeping the tags being applied across APIs the same look and feel for organizing and publishing to documentation. To
      fix: Ensure the targeted value matches the regular expression `[A-Z]\w*`; rewrite any value that does not. This rule
      is evaluated at the JSONPath `$.tags.*.name` — inspect every location it matches and correct only what violates the
      rule. Make the smallest change that satisfies the rule, leave all unrelated content, key order, comments, and formatting
      unchanged, and keep the document valid OpenAPI. Return only the complete corrected document, with no commentary.'
  openapi-tag-no-camel-case:
    title: Tag No Camel Case
    reference: https://spotlight-rules.com/spec/rules/openapi/tag-no-camel-case/
    description: Detects a tag with camelCase (personalItem) text within it.
    message: Tag names cannot use Camel Case. Please rename {{value}}.
    severity: info
    given:
    - $.tags[*].name
    - $.paths[*][*].tags[*]
    then:
      function: pattern
      functionOptions:
        notMatch: /^[a-z]+[A-Z][a-z]+$/g
    tags:
    - format:openapi
    - spec:paths
    - spec:tags
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''tag-no-camel-case'' (Tag No
      Camel Case). Requirement: Detects a tag with camelCase (personalItem) text within it. To fix: Ensure the targeted value
      does NOT match the regular expression `/^[a-z]+[A-Z][a-z]+$/g`; rename or rewrite any value that does. This rule is
      evaluated at the JSONPath `$.tags[*].name | $.paths[*][*].tags[*]` — inspect every location it matches and correct only
      what violates the rule. Make the smallest change that satisfies the rule, leave all unrelated content, key order, comments,
      and formatting unchanged, and keep the document valid OpenAPI. Return only the complete corrected document, with no
      commentary.'
  openapi-tag-no-pascal-case:
    title: Tag No Pascal Case
    reference: https://spotlight-rules.com/spec/rules/openapi/tag-no-pascal-case/
    description: Tag names cannot use Pascal Case. Please rename {{value}}.
    message: Tag names cannot use Pascal Case. Please rename {{value}}.
    severity: info
    given:
    - $.tags[*].name
    - $.paths[*][*].tags[*]
    then:
      function: pattern
      functionOptions:
        notMatch: /[A-Z][a-z]+[A-Z][a-z]+$/g
    tags:
    - format:openapi
    - spec:paths
    - spec:tags
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''tag-no-pascal-case'' (Tag
      No Pascal Case). Requirement: Tag names cannot use Pascal Case. Please rename {{value}}. To fix: Ensure the targeted
      value does NOT match the regular expression `/[A-Z][a-z]+[A-Z][a-z]+$/g`; rename or rewrite any value that does. This
      rule is evaluated at the JSONPath `$.tags[*].name | $.paths[*][*].tags[*]` — inspect every location it matches and correct
      only what violates the rule. Make the smallest change that satisfies the rule, leave all unrelated content, key order,
      comments, and formatting unchanged, and keep the document valid OpenAPI. Return only the complete corrected document,
      with no commentary.'
  openapi-tag-no-version-info:
    title: Tag No Version Info
    reference: https://spotlight-rules.com/spec/rules/openapi/tag-no-version-info/
    description: Tag names cannot have version information {{value}}. Consider versioning your API.
    message: Tag names cannot have version information {{value}}. Consider versioning your API.
    severity: info
    given:
    - $.tags[*].name
    - $.paths[*][*].tags[*]
    then:
      function: pattern
      functionOptions:
        notMatch: /(V|v)\s?[0-9]+/g
    tags:
    - format:openapi
    - spec:paths
    - spec:tags
    - experience:naming
    - experience:versioning
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''tag-no-version-info'' (Tag
      No Version Info). Requirement: Tag names cannot have version information {{value}}. Consider versioning your API. To
      fix: Ensure the targeted value does NOT match the regular expression `/(V|v)\s?[0-9]+/g`; rename or rewrite any value
      that does. This rule is evaluated at the JSONPath `$.tags[*].name | $.paths[*][*].tags[*]` — inspect every location
      it matches and correct only what violates the rule. Make the smallest change that satisfies the rule, leave all unrelated
      content, key order, comments, and formatting unchanged, and keep the document valid OpenAPI. Return only the complete
      corrected document, with no commentary.'
  openapi-tag-require-name:
    title: Tag Require Name
    reference: https://spotlight-rules.com/spec/rules/openapi/tag-require-name/
    description: Tags used as part of an OpenAPI should have names, providing a simple key word or phrase that represents
      the tag being applied to APIs.
    message: Tags MUST Have a Name
    severity: info
    given: $.tags[*]
    then:
      field: name
      function: truthy
    tags:
    - format:openapi
    - spec:tags
    - experience:discoverability
    - experience:naming
    prompt: 'You are editing an OpenAPI document to satisfy the Spotlight API governance rule ''tag-require-name'' (Tag Require
      Name). Requirement: Tags used as part of an OpenAPI should have names, providing a simple key word or phrase that represents
      the tag being applied to APIs. To fix: Ensure `name` is present and non-empty at each matching location. This rule is
      evaluated at the JSONPath `$.tags[*]` — inspect every location it matches and correct only what violates the rule. Make
      the smallest change that satisfies the rule, leave all unrelated content, key order, comments, and formatting unchanged,
      and keep the document valid OpenAPI. Return only the complete corrected document, with no commentary.'
  apis-json-api-property-require-vocabulary:
    title: API Property Require Vocabulary
    reference: https://spotlight-rules.com/spec/rules/apis-json/api-property-require-vocabulary/
    description: This property ensures that there is a centralized vocabulary in use for guiding the creation and usage of
      tags, path segments, and other metadata associated with an APIs.
    message: Has Vocabulary
    severity: info
    given:
    - $.apis.*.properties.*
    - $.common.*
    then:
    - field: type
      function: pattern
      functionOptions:
        notMatch: \b(vocabulary|vocabularies|Vocabulary|Vocabularies)\b
    tags:
    - format:apis-json
    - spec:apis
    - spec:properties
    - experience:consistency
    - experience:naming
    - experience:governance
    prompt: 'You are editing an APIs.json document to satisfy the Spotlight API governance rule ''api-property-require-vocabulary''
      (API Property Require Vocabulary). Requirement: This property ensures that there is a centralized vocabulary in use
      for guiding the creation and usage of tags, path segments, and other metadata associated with an APIs. To fix: Ensure
      `type` does NOT match the regular expression `\b(vocabulary|vocabularies|Vocabulary|Vocabularies)\b`; rename or rewrite
      any value that does. This rule is evaluated at the JSONPath `$.apis.*.properties.* | $.common.*` — inspect every location
      it matches and correct only what violates the rule. Make the smallest change that satisfies the rule, leave all unrelated
      content, key order, comments, and formatting unchanged, and keep the document valid APIs.json. Return only the complete
      corrected document, with no commentary.'
  apis-json-api-tag-require-upper-case:
    title: API Tag Require Upper Case
    reference: https://spotlight-rules.com/spec/rules/apis-json/api-tag-require-upper-case/
    description: Maintaining consistent casing for tags applied to individual APIs ensures a uniform appearance and enhances
      search and discovery. Each word in a tag should be capitalized, with the first letter of every word in a phrase treated
      the same way.
    message: API Tags MUST Be Upper Case
    severity: info
    given: $.apis.*.tags.*
    then:
      function: pattern
      functionOptions:
        match: '[A-Z]\w*'
    tags:
    - format:apis-json
    - spec:apis
    - spec:tags
    - experience:naming
    - experience:consistency
    - experience:discoverability
    prompt: 'You are editing an APIs.json document to satisfy the Spotlight API governance rule ''api-tag-require-upper-case''
      (API Tag Require Upper Case). Requirement: Maintaining consistent casing for tags applied to individual APIs ensures
      a uniform appearance and enhances search and discovery. Each word in a tag should be capitalized, with the first letter
      of every word in a phrase treated the same way. To fix: Ensure the targeted value matches the regular expression `[A-Z]\w*`;
      rewrite any value that does not. This rule is evaluated at the JSONPath `$.apis.*.tags.*` — inspect every location it
      matches and correct only what violates the rule. Make the smallest change that satisfies the rule, leave all unrelated
      content, key order, comments, and formatting unchanged, and keep the document valid APIs.json. Return only the complete
      corrected document, with no commentary.'
  apis-json-tag-require-upper-case:
    title: Tag Require Upper Case
    reference: https://spotlight-rules.com/spec/rules/apis-json/tag-require-upper-case/
    description: Maintaining consistent casing for tags applied to APIs.json contracts ensures a uniform appearance and enhances
      search and discovery. Each word in a tag should be capitalized, with the first letter of every word in a phrase treated
      the same way.
    message: Tags Upper Case
    severity: info
    given: $.tags.*
    then:
      function: pattern
      functionOptions:
        match: '[A-Z]\w*'
    tags:
    - format:apis-json
    - spec:tags
    - experience:naming
    - experience:consistency
    - experience:discoverability
    prompt: 'You are editing an APIs.json document to satisfy the Spotlight API governance rule ''tag-require-upper-case''
      (Tag Require Upper Case). Requirement: Maintaining consistent casing for tags applied to APIs.json contracts ensures
      a uniform appearance and enhances search and discovery. Each word in a tag should be capitalized, with the first letter
      of every word in a phrase treated the same way. To fix: Ensure the targeted value matches the regular expression `[A-Z]\w*`;
      rewrite any value that does not. This rule is evaluated at the JSONPath `$.tags.*` — inspect every location it matches
      and correct only what violates the rule. Make the smallest change that satisfies the rule, leave all unrelated content,
      key order, comments, and formatting unchanged, and keep the document valid APIs.json. Return only the complete corrected
      document, with no commentary.'
  asyncapi-schema-asyncapi-property-camel-case:
    title: Schema Asyncapi Property Camel Case
    reference: https://spotlight-rules.com/spec/rules/asyncapi/schema-asyncapi-property-camel-case/
    description: Schema property names should be camelCase.
    message: Schema property is not camelCase.
    given: $.components.schemas[*].properties[*]~
    severity: info
    then:
      function: pattern
      functionOptions:
        match: ^[a-z][a-zA-Z0-9]*$
    tags:
    - format:asyncapi
    - spec:components
    - experience:naming
    - experience:consistency
    prompt: 'You are editing an AsyncAPI document to satisfy the Spotlight API governance rule ''schema-asyncapi-property-camel-case''
      (Schema Asyncapi Property Camel Case). Requirement: Schema property names should be camelCase. To fix: Ensure the targeted
      value matches the regular expression `^[a-z][a-zA-Z0-9]*$`; rewrite any value that does not. This rule is evaluated
      at the JSONPath `$.components.schemas[*].properties[*]~` — inspect every location it matches and correct only what violates
      the rule. Make the smallest change that satisfies the rule, leave all unrelated content, key order, comments, and formatting
      unchanged, and keep the document valid AsyncAPI. Return only the complete corrected document, with no commentary.'
  json-structure-schema-json-structure-property-camel-case:
    title: Schema JSON Structure Property Camel Case
    reference: https://spotlight-rules.com/spec/rules/json-structure/schema-json-structure-property-camel-case/
    description: Property names should be camelCase.
    message: Property is not camelCase.
    given: $.properties[*]~
    severity: info
    then:
      function: pattern
      functionOptions:
        match: ^[a-z][a-zA-Z0-9]*$
    tags:
    - format:json-structure
    - spec:schemas
    - experience:naming
    - experience:consistency
    prompt: 'You are editing a JSON Structure document to satisfy the Spotlight API governance rule ''schema-json-structure-property-camel-case''
      (Schema JSON Structure Property Camel Case). Requirement: Property names should be camelCase. To fix: Ensure the targeted
      value matches the regular expression `^[a-z][a-zA-Z0-9]*$`; rewrite any value that does not. This rule is evaluated
      at the JSONPath `$.properties[*]~` — inspect every location it matches and correct only what violates the rule. Make
      the smallest change that satisfies the rule, leave all unrelated content, key order, comments, and formatting unchanged,
      and keep the document valid JSON Structure. Return only the complete corrected document, with no commentary.'
  mcp-document-mcp-name-kebab-case:
    title: Document MCP Name Kebab Case
    reference: https://spotlight-rules.com/spec/rules/mcp/document-mcp-name-kebab-case/
    description: MCP server name should be lower kebab-case.
    message: MCP server name should be kebab-case.
    given: $.name
    severity: info
    then:
      function: pattern
      functionOptions:
        match: ^[a-z0-9]+(?:-[a-z0-9]+)*$
    tags:
    - format:mcp
    - spec:document
    - experience:naming
    - experience:consistency
    prompt: 'You are editing a MCP document to satisfy the Spotlight API governance rule ''document-mcp-name-kebab-case''
      (Document MCP Name Kebab Case). Requirement: MCP server name should be lower kebab-case. To fix: Ensure the targeted
      value matches the regular expression `^[a-z0-9]+(?:-[a-z0-9]+)*$`; rewrite any value that does not. This rule is evaluated
      at the JSONPath `$.name` — inspect every location it matches and correct only what violates the rule. Make the smallest
      change that satisfies the rule, leave all unrelated content, key order, comments, and formatting unchanged, and keep
      the document valid MCP. Return only the complete corrected document, with no commentary.'
  agent-skill-skill-name-kebab-case:
    title: Skill Name Kebab Case
    reference: https://spotlight-rules.com/spec/rules/agent-skill/skill-name-kebab-case/
    description: Skill name should be lower kebab-case so it matches the skill directory name and stays portable.
    message: Skill name should be lower kebab-case.
    severity: info
    given: $.frontmatter.name
    then:
      function: pattern
      functionOptions:
        match: ^[a-z0-9]+(?:-[a-z0-9]+)*$
    tags:
    - format:agent-skill
    - spec:frontmatter
    - experience:naming
    prompt: 'You are editing an Agent Skill document to satisfy the Spotlight API governance rule ''skill-name-kebab-case''
      (Skill Name Kebab Case). Requirement: Skill name should be lower kebab-case so it matches the skill directory name and
      stays portable. To fix: Ensure the targeted value matches the regular expression `^[a-z0-9]+(?:-[a-z0-9]+)*$`; rewrite
      any value that does not. This rule is evaluated at the JSONPath `$.frontmatter.name` — inspect every location it matches
      and correct only what violates the rule. Make the smallest change that satisfies the rule, leave all unrelated content,
      key order, comments, and formatting unchanged, and keep the document valid Agent Skill. Return only the complete corrected
      document, with no commentary.'
  agent-skill-skill-name-max-length:
    title: Skill Name Max Length
    reference: https://spotlight-rules.com/spec/rules/agent-skill/skill-name-max-length/
    description: A skill name should be concise (64 characters or fewer).
    message: Skill name should be 64 characters or fewer.
    given: $.frontmatter.name
    severity: info
    then:
      function: schema
      functionOptions:
        schema:
          type: string
          maxLength: 64
    tags:
    - format:agent-skill
    - spec:frontmatter
    - experience:naming
    - experience:usability
    prompt: 'You are editing an Agent Skill document to satisfy the Spotlight API governance rule ''skill-name-max-length''
      (Skill Name Max Length). Requirement: A skill name should be concise (64 characters or fewer). To fix: Adjust the targeted
      value so it conforms to the schema this rule requires. This rule is evaluated at the JSONPath `$.frontmatter.name` —
      inspect every location it matches and correct only what violates the rule. Make the smallest change that satisfies the
      rule, leave all unrelated content, key order, comments, and formatting unchanged, and keep the document valid Agent
      Skill. Return only the complete corrected document, with no commentary.'
