---
rules:
  apis-json-apis-aid-error:
    description: >-
      Every API should have a unique identifier, known as an AID (API
      Identifier). The APIs.json file, contract, or collection contains its own
      AID, which the API uses as part of its reference. Additionally, the API
      applies a slugified version of its name, resulting in a unique,
      human-readable identifier for the API.
    message: APIs MUST have an aid property.
    given: $.apis.*
    severity: error
    then:
      field: aid
      function: truthy
  apis-json-apis-aid-info:
    description: >-
      Every API should have a unique identifier, known as an AID (API
      Identifier). The APIs.json file, contract, or collection contains its own
      AID, which the API uses as part of its reference. Additionally, the API
      applies a slugified version of its name, resulting in a unique,
      human-readable identifier for the API.
    message: APIs MUST have an aid property.
    given: $.apis.*
    severity: info
    then:
      field: aid
      function: falsy
  apis-json-apis-baseURL-error:
    description: >-
      Each API defined within an APIs.json artifact can specify the base URL for
      the API. This URL serves as a reference point for developers during
      onboarding and when making API calls. Additionally, it helps identify the
      API and validate the domain it is associated with.
    message: APIs MUST Have a Base URL
    given: $.apis.*
    severity: error
    then:
      field: baseURL
      function: truthy
  apis-json-apis-baseURL-info:
    description: >-
      Each API defined within an APIs.json artifact can specify the base URL for
      the API. This URL serves as a reference point for developers during
      onboarding and when making API calls. Additionally, it helps identify the
      API and validate the domain it is associated with.
    message: APIs Has a Base URL
    given: $.apis.*
    severity: info
    then:
      field: baseURL
      function: falsy
  apis-json-apis-contact-email-error:
    description: >-
      The contact object in an APIs.json file allows for referencing the email
      address of a person or group. This property provides a convenient way for
      users to seek support for an API, using email as the default method to
      reach the team managing the API in production.
    message: API contact COULD have email.
    given: $.apis.*.contact.*
    severity: error
    then:
      field: email
      function: truthy
  apis-json-apis-contact-email-info:
    description: >-
      The contact object in an APIs.json file allows for referencing the email
      address of a person or group. This property provides a convenient way for
      users to seek support for an API, using email as the default method to
      reach the team managing the API in production.
    message: API contact has email.
    given: $.apis.*.contact.*
    severity: info
    then:
      field: email
      function: falsy
  apis-json-apis-contact-error:
    description: >-
      The contact object in an APIs.json file allows for associating a vCard
      that represents an individual or organizational entity. It includes common
      contact information such as a name, email, or other references, offering a
      standardized method for providing support for an API.
    message: API COULD have a contact.
    severity: warn
    given: $.apis.*
    then:
      field: contact
      function: truthy
  apis-json-apis-contact-fn-error:
    description: >-
      The contact object in an APIs.json file includes a full name (FN)
      property, which specifies the formatted text corresponding to the contact
      name in the vCard for an API. This provides a quick and clear way to
      assign a person, group, or other point of contact to an API for addressing
      questions and providing support.
    message: Contact Could Have FN
    given: $.apis.*.contact.*
    severity: error
    then:
      field: FN
      function: truthy
  apis-json-apis-contact-fn-info:
    description: >-
      The contact object in an APIs.json file includes a full name (FN)
      property, which specifies the formatted text corresponding to the contact
      name in the vCard for an API. This provides a quick and clear way to
      assign a person, group, or other point of contact to an API for addressing
      questions and providing support.
    message: Contact Has FN
    given: $.apis.*.contact.*
    severity: info
    then:
      field: FN
      function: falsy
  apis-json-apis-contact-info:
    description: >-
      The contact object in an APIs.json file allows for associating a vCard
      that represents an individual or organizational entity. It includes common
      contact information such as a name, email, or other references, offering a
      standardized method for providing support for an API.
    message: Has a Contract
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      field: contact
      function: falsy
  apis-json-apis-description-info:
    description: >-
      Each API included in an APIs.json file should have a 1-3 paragraph
      description. This description serves as the first impression for potential
      consumers and is often displayed in portals, networks, search results, and
      other discovery channels. A well-crafted description plays a key role in
      helping API consumers understand and onboard with the API effectively.
    message: Has a Description
    given: $.apis.*
    severity: info
    then:
      field: description
      function: falsy
  apis-json-apis-humanURL-info:
    description: >-
      The humanURL property for each API defined in an APIs.json contract
      provides a link for business or technical consumers to learn more about
      the API. This URL can direct users to a portal, documentation, or ideally,
      a dedicated landing page designed specifically to onboard consumers with a
      single API.
    message: Has a Human URL
    given: $.apis.*
    severity: info
    then:
      field: humanURL
      function: falsy
  apis-json-apis-image-info:
    description: >-
      Each API defined within an APIs.json file can include a dedicated image,
      offering a visual representation of the resource or capability it
      provides. This enhances the API's approachability and visual appeal in
      portals, documentation, catalogs, and marketplaces, making it more
      engaging for potential users.
    message: Has an Image
    given: $.apis.*
    severity: info
    then:
      field: image
      function: falsy
  apis-json-apis-info:
    description: >-
      The APIs property in an APIs.json file enables the definition of one or
      more APIs as part of a larger collection. Each API within this property
      has its own subset of metadata, allowing it to be uniquely identified and
      distinguished from the rest of the collection. This individual metadata
      contributes to the overall value and functionality of the API collection.
    message: Has APIs
    given: $
    severity: info
    then:
      field: apis
      function: falsy
  apis-json-apis-name-info:
    description: >-
      Each individual API in an APIs.json collection has its own name property,
      allowing for a clear description of the API. This name might match the
      API's title in the OpenAPI Info section, but it could also represent the
      API's business purpose, as displayed in catalogs and search results.
    message: Has a Name
    given: $.apis.*
    severity: info
    then:
      field: name
      function: falsy
  apis-json-apis-properties-about-info:
    description: >-
      Each individual API included in an APIs.json file can have a properties
      collection, which contains specific properties relevant to that API. These
      properties often start with human-readable elements, such as documentation
      links, and can also include machine-readable properties to enhance
      functionality and integration.
    message: Has About
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(about|About)\b
  apis-json-apis-properties-apiop-cycles-business-impact-canvas-info:
    description: >-
      This ensures that an API has had the APIOps Business Impact Canvas applied
      to the API, requiring that the canvas is present in the repository and
      registered in the APIs.json index for the API, helping with discovery and
      governance.
    message: Has APIOps Cycles Business Impact Canvas
    severity: info
    given:
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(APIOpsBusinessImpactCanvas)\b
  apis-json-apis-properties-apiop-cycles-business-model-canvas-info:
    description: >-
      This ensures that an API has had the APIOps Business Model Canvas applied
      to the API, requiring that the canvas is present in the repository and
      registered in the APIs.json index for the API, helping with discovery and
      governance.
    message: Has APIOps Cycles Business Model Canvas
    severity: info
    given:
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(APIOpsBusinessModelCanvas)\b
  apis-json-apis-properties-apiop-cycles-capacity-canvas-info:
    description: >-
      This ensures that an API has had the APIOps Capacity Canvas applied to the
      API, requiring that the canvas is present in the repository and registered
      in the APIs.json index for the API, helping with discovery and governance.
    message: Has APIOps Cycles Capacity Canvas
    severity: info
    given:
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(APIOpsCapacityCanvas)\b
  apis-json-apis-properties-apiop-cycles-customer-journey-canvas-info:
    description: >-
      This ensures that an API has had the APIOps Customer Journey Canvas
      applied to the API, requiring that the canvas is present in the repository
      and registered in the APIs.json index for the API, helping with discovery
      and governance.
    message: Has APIOps Cycles Customer Journey Canvas
    severity: info
    given:
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(APIOpsCustomerJourneyCanvas)\b
  apis-json-apis-properties-apiop-cycles-domain-canvas-info:
    description: >-
      This ensures that an API has had the APIOps Domain Canvas applied to the
      API, requiring that the canvas is present in the repository and registered
      in the APIs.json index for the API, helping with discovery and governance.
    message: Has APIOps Cycles Domain Canvas
    severity: info
    given:
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(APIOpsDomainCanvas)\b
  apis-json-apis-properties-apiop-cycles-event-canvas-info:
    description: >-
      This ensures that an API has had the APIOps Event Canvas applied to the
      API, requiring that the canvas is present in the repository and registered
      in the APIs.json index for the API, helping with discovery and governance.
    message: Has APIOps Cycles Event Canvas
    severity: info
    given:
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(APIOpsEventCanvas)\b
  apis-json-apis-properties-apiop-cycles-interaction-canvas-info:
    description: >-
      This ensures that an API has had the APIOps Interaction Canvas applied to
      the API, requiring that the canvas is present in the repository and
      registered in the APIs.json index for the API, helping with discovery and
      governance.
    message: Has APIOps Cycles Interaction Canvas
    severity: info
    given:
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(APIOpsCustomerJourneyCanvas)\b
  apis-json-apis-properties-apiop-cycles-locations-canvas-info:
    description: >-
      This ensures that an API has had the APIOps Locations Canvas applied to
      the API, requiring that the canvas is present in the repository and
      registered in the APIs.json index for the API, helping with discovery and
      governance.
    message: Has APIOps Cycles Locations Canvas
    severity: info
    given:
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(APIOpsLocationsCanvas)\b
  apis-json-apis-properties-apiop-cycles-rest-canvas-info:
    description: >-
      This ensures that an API has had the APIOps Locations Canvas applied to
      the API, requiring that the canvas is present in the repository and
      registered in the APIs.json index for the API, helping with discovery and
      governance.
    message: Has APIOps Cycles Locations Canvas
    severity: info
    given:
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(APIOpsRestCanvas)\b
  apis-json-apis-properties-apiop-cycles-value-proposition-canvas-info:
    description: >-
      This ensures that an API has had the APIOps Value Proposition Canvas
      applied to the API, requiring that the canvas is present in the repository
      and registered in the APIs.json index for the API, helping with discovery
      and governance.
    message: Has APIOps Cycles Value Proposition Canvas
    severity: info
    given:
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(APIOpsValuePropositionCanvas)\b
  apis-json-apis-properties-apis-json-rules-info:
    description: This property ensures that an API has operational level rules for APIs
    message: Has Operational Rules
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(operational-rules|OperationalRules)\b
  apis-json-apis-properties-apis-json-validator-info:
    description: This property ensures that there is a link to the validator for the APIs
    message: Has APIs.json (Business) Validator
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(OperationalValidation)\b
  apis-json-apis-properties-authentication-info:
    description: >-
      This property ensures that there is a human readable authentication page
      available that will provide what type of authentication is used and how it
      can be applied, as well as any services or tooling that API consumers can
      use to troubleshoot authentication with APIs
    message: Has Authentication
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(Authentication)\b
  apis-json-apis-properties-blog-feed-info:
    description: >-
      This property ensures that blogs in support of APIs have an Atom or RSS
      feed of posts, allowing for the syndication of updates and information
      around individual APIs and the operations around them
    message: Has a Blog Feed
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(blog-feed|BlogFeeds)\b
  apis-json-apis-properties-blog-info:
    description: >-
      This property ensures that an API has a reference to a blog where anyone
      can find updates and other stories that will help keep API consumers and
      other stakeholders up to speed on what is happening with an API, and the
      larger operations
    message: Has a Blog
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(blog|Blogs)\b
  apis-json-apis-properties-change-log-info:
    description: >-
      This property ensures that than an individual API or API operations
      possesses a change log that catalogs all the changes that have occurred in
      a recent time frame, with historical and version information available if
      possible
    message: Has Change Log
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(api-change-log|change-log|Change Log|Changelog|ChangeLog)\b
  apis-json-apis-properties-compare-info:
    description: >-
      This property ensures that an API has the ability to compare two different
      versions of an API and see what the difference are between them
    message: Has an API Comparison
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(compare|Compare)\b
  apis-json-apis-properties-deprecation-policy-info:
    description: >-
      This property ensures that an API has a deprecation policy shared as part
      of the contract, communicating what the lifespan of APIs are, each
      individual version, as well as communication around the deprecation of
      APIs
    message: Has Deprecation Policy
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: >-
            \b(api-deprecation-policy|deprecation-policy|Deprecation|Deprecation
            Policy|DeprecationPolicy)\b
  apis-json-apis-properties-documentation-info:
    description: >-
      This property ensures that there is documentation published for an API,
      and API consumers will have a set of human-readable instructions for
      onboarding and integrating with HTTP APIs in their applications
    message: Has Documentation
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(documentation|Documentation)\b
  apis-json-apis-properties-environments-production-info:
    description: >-
      This property ensures that there is a production environment available for
      an API, providing base URL, tokens, keys, and other key / value pairs that
      are needed to integrate with an API
    message: Has a Production Environment
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(ProductionEnvironment)\b
  apis-json-apis-properties-environments-staging-info:
    description: >-
      This property ensures that there is a staging environment available for an
      API, providing base URL, tokens, keys, and other key / value pairs that
      are needed to integrate with an API
    message: Has a Stage Environment
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(StagingEnvironment)\b
  apis-json-apis-properties-examples-info:
    description: >-
      This property ensures that an API has a reference to a examples for
      individual APIs or as part of common properties, providing examples and
      synthentic data that can be used for APIs.
    message: Has a Blog
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(examples|Examples)\b
  apis-json-apis-properties-feedback-email-info:
    description: >-
      This property ensures that there is an email available for API consumers
      to provide feedback
    message: Has Feedback Email
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(feedback-email|FeedbackEmail)\b
  apis-json-apis-properties-feedback-issues-info:
    description: >-
      This property ensures there is a URL to Git issues specifically for
      providing feedback
    message: Has Feedback Issues URL
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(FeedbackIssues|FeedbackGitHubIssues)\b
  apis-json-apis-properties-forum-info:
    description: >-
      This property ensures that there is a link to a discussion forum,
      providing a way for consumers and producers to engage and support either
      other throughout the lifecycle
    message: Has Discussion Forum
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(Forums|Forums|Discussions)\b
  apis-json-apis-properties-gateway-info:
    description: >-
      This property ensures that there is a reference to the gateway for an API,
      referencing where you can manage the configuration for each API
    message: Has Staging Gateway for API
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(gateway|Gateway)\b
  apis-json-apis-properties-getting-started-info:
    description: >-
      This property ensures that there is a getting started link available,
      providing a reference for API consumers to get started with an API is as
      few steps as possible
    message: Has Getting Started
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(GettingStarted)\b
  apis-json-apis-properties-github-action-info:
    description: >-
      This property ensures that a GitHub Actions CI/CD pipeline is available
      for an API, providing a link to the pipeline YAML artifact, which can be
      used to automate and govern the API as part of the build process
    message: Has a GitHub Action
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(github-actions|GitHubActions)\b
  apis-json-apis-properties-github-organization-info:
    description: >-
      This property ensures that an API is associated with GitHub organization,
      providing the URL to where you can engage with the operations surrounding
      an API
    message: Has a GitHub Organization
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(github-organization|GitHubOrganization)\b
  apis-json-apis-properties-github-repository-info:
    description: >-
      This property ensures that an API possess a reference to a dedicated
      GitHub repository that is used to manage the Open, but also possible
      server and client code
    message: Has a GitHub Repository
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(github-repository|GitHubRepository)\b
  apis-json-apis-properties-insomnia-collection-info:
    description: >-
      This property defines an Insomnia collection available for each API,
      providing executable artifacts that can be used in the Insomnia client for
      making calls, and executing automation workflows
    message: Has Insomnia Collection
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(RunInInsomnia)\b
  apis-json-apis-properties-license-info:
    description: >-
      This property ensures that an API Commons interface license exists for an
      API, providing a machine-readable reference for an API, as well as data,
      backend, and front-end code
    message: Has Interface License
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(api-license|License|license|InterfaceLicense)\b
  apis-json-apis-properties-lifecycle-info:
    description: >-
      This property makes sure there is an API lifecycle schema defining all of
      the stages of a lifecycle and which policies get applied at each stage of
      the API lifecycle
    message: Has an API Lifecycle
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(lifecycle|Lifecycle)\b
  apis-json-apis-properties-mock-server-info:
    description: >-
      This property ensures that an API has a reference to a mock servers for
      individual APIs or as part of common properties, providing mocked
      deployments of an API that can be used for making test API calls.
    message: Has a Mock Server
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(mocks|Mocks|MockServers)\b
  apis-json-apis-properties-openapi-info:
    description: >-
      This property ensures that there is an OpenAPI present for an API,
      providing the technical contract that describes the surface area of an API
    message: Has An OpenAPI
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(openapi|OpenAPI)\b
  apis-json-apis-properties-openapi-rules-info:
    description: >-
      This property ensures that an OpenAPI has support governance rules, that
      can be applied during design time via editors, development time via IDE,
      and run-time via CI/CD pipelines
    message: Has API Rules
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(api-rules|ApiRules)\b
  apis-json-apis-properties-openapi-validator-info:
    description: >-
      This property ensures that there is a link to the validator for the
      OpenAPI technical contract, allowing anyone to see the details of
      governance being applied
    message: Has OpenAPI (Technical) Validator
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(APIValidation)\b
  apis-json-apis-properties-performance-info:
    description: >-
      This property ensures that an API has performance testing in place,
      providing a URL to the performance testing, dashboard, or other resource
    message: Has API Performance
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(Performance|PerformanceTesting)\b
  apis-json-apis-properties-plans-info:
    description: >-
      This property provides a link to the dedicated plans page that applies to
      an API, providing information about access tiers, rate limits, and
      features available for an API as part of a wider API business plan
    message: Has API Plans
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(api-plans|Plans)\b
  apis-json-apis-properties-policies-info:
    description: >-
      This property ensures there is a governance policies reference as part of
      an API contract, usually a common property pointing to a centralized set
      of policies that get applied
    message: Has API Governance Policies
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(api-policies|Policies)\b
  apis-json-apis-properties-portal-info:
    description: >-
      This property ensures there a developer portal associated with an API and
      that you can find a landing page for the API, documentation, SDKs, and
      other resources
    message: Has Developer Portal
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: >-
            \b(api-developer-portal|developer-portal|portal|Portal|Portals|DeveloperPortal)\b
  apis-json-apis-properties-postman-collection-info:
    description: >-
      This property ensures that an API has at least one Postman Collection
      associated with it, providing automation, tests, and other executable
      derivatives of an APIs OpenAPI
    message: Has a Postman Collection
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(PostmanCollection)\b
  apis-json-apis-properties-postman-public-workspace-info:
    description: >-
      This property ensures that an API is associated with a Postman Workspace,
      providing a single location that API producers and/or API consumers can
      engage around an API
    message: Has Public Postman Workspace
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: >-
            \b(postman-public-workspace|PostmanPublicWorkspace|PostmanWorkspace)\b
  apis-json-apis-properties-pricing-info:
    description: >-
      This property provides a link to a pricing page that applies to an API,
      providing a breakdown of the costs associated with using an API
    message: Has Pricing
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(Pricing)\b
  apis-json-apis-properties-privacy-policy-info:
    description: >-
      This property provides a link to the privacy policy for an API, providing
      the legal details of how privacy is approached for each API
    message: Has an API Privacy Policy
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: >-
            \b(api-privacy-policy|privacy-policy|Privacy|Privacy
            Policy|PrivacyPolicy)\b
  apis-json-apis-properties-questions-issues-info:
    description: >-
      This property ensures that an API has a dedicated link to Git issues for
      asking questions
    message: Has Questions Issues URL
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(QuestionsIssues|QuestionsGitHubIssues)\b
  apis-json-apis-properties-rate-limits-info:
    description: >-
      This property ensures there is an API rate limits reference associated
      with API, ensuring the rate limits applied to an API are clearly
      communicated
    message: Has an API Terms of Services
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(rate-limits|RateLimits|Rate Limits)\b
  apis-json-apis-properties-road-map-info:
    description: >-
      This property ensures there is a reference to the road map for an API or
      for the entire API operations within domain, line of business, or teams
    message: Has a Road Map
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(api-road-map|road-map|Roadmap|Road Map|RoadMap)\b
  apis-json-apis-properties-rules-info:
    description: >-
      This property ensures that an API has governance rules applied, usually as
      part of a central set of governance rules, defined by policy, or stages of
      the API lifecycle
    message: Has Linting Rules
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(api-rules|OpenApiRules)\b
  apis-json-apis-properties-sandbox-info:
    description: >-
      This property ensures that an API has a reference to a sandbox for
      individual APIs or as part of common properties, providing sandbox,
      synthetic data, and mock servers for use in making test requests.
    message: Has a Blog
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(sandbox|Sandbox)\b
  apis-json-apis-properties-sdk-go-info:
    description: >-
      This property ensures that there is a Go SDK available for an API, making
      it easier for Go developers to integrate an API into their applications
    message: Has Go SDK
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(api-sdk-go)\b
  apis-json-apis-properties-sdk-info:
    description: >-
      This property ensures that there is an SDK available for an API, making it
      easier for developers to integrate an API into their applications
    message: Has SDK
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(sdk|sdks|SDKs)\b
  apis-json-apis-properties-sdk-java-info:
    description: >-
      This property ensures that there is a Java SDK available for an API,
      making it easier for Java developers to integrate an API into their
      applications
    message: Has Java SDK
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(api-sdk-java)\b
  apis-json-apis-properties-sdk-node-info:
    description: >-
      This property ensures that there is a Node SDK available for an API,
      making it easier for Node developers to integrate an API into their
      applications
    message: Has Node SDK
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(api-sdk-node)\b
  apis-json-apis-properties-sdk-python-info:
    description: >-
      This property ensures that there is a Python SDK available for an API,
      making it easier for Python developers to integrate an API into their
      applications
    message: Has Python SDK
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(api-sdk-python)\b
  apis-json-apis-properties-security-info:
    description: >-
      This property ensures there is a URL to the security page, providing
      details about how security is handled for an API
    message: Has Security Path
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(Security|SecurityTesting)\b
  apis-json-apis-properties-signup-info:
    description: >-
      This property ensures there is a link to where you sign up for an API,
      making sure API consumers can access in a single click
    message: Has a Sign Up
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(X-signup|signup|Sign Up|SignUp)\b
  apis-json-apis-properties-status-info:
    description: >-
      This property ensures that there is a status page available for each API,
      providing the uptime status for any given moment, as well as historical
      data
    message: Has a Status Page
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(x-status|status|Status|StatusPage)\b
  apis-json-apis-properties-support-email-info:
    description: >-
      This property ensures that an API has email support, providing a valid
      email address that can be used to get API support
    message: Has Support Email
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(support-email|SupportEmail)\b
  apis-json-apis-properties-support-issues-info:
    description: >-
      This property ensures that there are Git issues available to support an
      API, using the issues capability of GitHub, GitLab, or Bitbucket to
      support API consumers
    message: Has Support Issues URL
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(SupportIssues|SupportGitHubIssues)\b
  apis-json-apis-properties-support-support-info:
    description: >-
      This property ensures that there is a support page available for an API,
      providing direct and in-direct support opportunities for each API or for
      entire API platform
    message: Has Support Page
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(support|Support)\b
  apis-json-apis-properties-teams-info:
    description: >-
      This property ensures that there is a reference to the team behind an API,
      providing a reference to business and engineering stakeholders
    message: Has a Team Defined
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(team|teams|Team|Teams)\b
  apis-json-apis-properties-terms-of-service-info:
    description: >-
      This property ensures that an API has a reference to a terms of service,
      covering the legal side of using an API
    message: Has an API Terms of Service
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: >-
            \b(api-terms-of-service|terms-of-service|Terms of
            Service|TOS|TermsOfService)\b
  apis-json-apis-properties-url-info:
    description: >-
      This property ensures that properties of an API or API contract all have
      valid URLs, checking if any of the URLs are not properly formed, or could
      be other formats
    message: Property URLs Are Valid
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: url
        function: pattern
        functionOptions:
          notMatch: >-
            ^((http|https)://)[-a-zA-Z0-9@:%._\+~#?&//=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%._\+~#?&//=]*)$
  apis-json-apis-properties-use-cases-info:
    description: >-
      This property ensures there is a reference to the use cases for an API,
      helping align an API with the who, what, how, and why of putting an API to
      work
    message: Has Use Cases
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(UseCases)\b
  apis-json-apis-properties-versioning-info:
    description: >-
      This property ensures there is a reference to how APIs are versioned,
      providing a single place where teams can learn about how change is
      communicated
    message: Has Versioning for API
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(versions|Versions|Versioning|versioning)\b
  apis-json-apis-properties-video-info:
    description: >-
      This property ensures there is a reference to a video page or channel for
      an API
    message: Has Videos for API
    severity: info
    given:
      - $.apis.*.properties.*
      - $.common.*
    then:
      - field: type
        function: pattern
        functionOptions:
          notMatch: \b(videos|Videos)\b
  apis-json-apis-properties-vocabulary-info:
    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
  apis-json-apis-tags-error:
    description: >-
      Each API defined in an APIs.json artifact includes a property for adding
      one or more tags. These tags provide additional context about the
      resources or capabilities offered by the API, highlighting its business
      value and the domain in which it is applied.
    message: API MUST Have a Tags Object
    given: $.apis.*
    severity: info
    then:
      field: tags
      function: truthy
  apis-json-apis-tags-info:
    description: >-
      Each API defined in an APIs.json artifact includes a property for adding
      one or more tags. These tags provide additional context about the
      resources or capabilities offered by the API, highlighting its business
      value and the domain in which it is applied.
    message: API Have a Tags Object
    given: $.apis.*
    severity: info
    then:
      field: tags
      function: falsy
  apis-json-apis-tags-upper-case-error:
    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: error
    given: $.apis.*.tags.*
    then:
      function: pattern
      functionOptions:
        match: '[A-Z]\w*'
  apis-json-apis-tags-upper-case-info:
    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 are Upper Case
    severity: info
    given: $.apis.*.tags.*
    then:
      function: pattern
      functionOptions:
        notMatch: '[A-Z]\w*'