CoreLogic (Cotality) · API Governance Rules

CoreLogic (Cotality) API Rules

Spectral linting rules defining API design standards and conventions for CoreLogic (Cotality).

CoreLogic (Cotality) API Rules is a Spectral governance ruleset published by CoreLogic (Cotality) on the APIs.io network, containing 9 lint rules.

The ruleset includes 6 error-severity rules and 3 warning-severity rules.

Tagged areas include Climate Risk, CoreLogic, Cotality, Direct Web API, and Hazard Data.

Rulesets can be applied to your own OpenAPI specs via Spectral to enforce the same governance standards.

9 Rules error 6 warn 3
View Rules File View on GitHub

Rule Categories

directcrm

Rules

error
directcrm-info-contact
API info object must declare contact info pointing at Trestle support.
$.info
error
directcrm-server-https
Servers must use HTTPS.
$.servers[*].url
error
directcrm-base-url
Base URL must reference the api.cotality.com Trestle OData endpoint.
$.servers[*].url
error
directcrm-oidc-or-basic
Security must support OpenID Connect (Clareity SSO) or HTTP Basic.
$.components.securitySchemes
warn
directcrm-core-resources
API must expose the documented CRM resources.
$.paths
warn
directcrm-portal-actions
PortalContents must expose AddListingNote / MarkAsViewed / SetListingPreference actions.
$.paths
error
directcrm-operation-id
Every operation must define a camelCase operationId.
$.paths.*.*
warn
directcrm-summary-title-case
Operation summaries must be in Title Case.
$.paths.*.*.summary
error
directcrm-tags-required
Every operation must declare at least one tag.
$.paths.*.*

Spectral Ruleset

Raw ↑
extends: ["spectral:oas"]
documentationUrl: https://trestle-documentation.corelogic.com/direct-webapi-crm-reference.html
rules:
  directcrm-info-contact:
    description: API info object must declare contact info pointing at Trestle support.
    given: "$.info"
    severity: error
    then:
      field: contact
      function: truthy
  directcrm-server-https:
    description: Servers must use HTTPS.
    given: "$.servers[*].url"
    severity: error
    then:
      function: pattern
      functionOptions:
        match: "^https://"
  directcrm-base-url:
    description: Base URL must reference the api.cotality.com Trestle OData endpoint.
    given: "$.servers[*].url"
    severity: error
    then:
      function: pattern
      functionOptions:
        match: "api.cotality.com/trestle/odata"
  directcrm-oidc-or-basic:
    description: Security must support OpenID Connect (Clareity SSO) or HTTP Basic.
    given: "$.components.securitySchemes"
    severity: error
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          anyOf:
            - required: [oidcClareity]
            - required: [basicAuth]
  directcrm-core-resources:
    description: API must expose the documented CRM resources.
    given: "$.paths"
    severity: warn
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          required:
            - /Contacts
            - /EmailHistory
            - /Lists
            - /PortalContents
            - /SavedSearches
            - /UserRegistry
  directcrm-portal-actions:
    description: PortalContents must expose AddListingNote / MarkAsViewed / SetListingPreference actions.
    given: "$.paths"
    severity: warn
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          required:
            - /PortalContents/AddListingNote
            - /PortalContents/MarkAsViewed
            - /PortalContents/SetListingPreference
  directcrm-operation-id:
    description: Every operation must define a camelCase operationId.
    given: "$.paths.*.*"
    severity: error
    then:
      field: operationId
      function: truthy
  directcrm-summary-title-case:
    description: Operation summaries must be in Title Case.
    given: "$.paths.*.*.summary"
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: "^([A-Z][a-zA-Z0-9]*)(\\s+[A-Z$][a-zA-Z0-9$()]*)*$"
  directcrm-tags-required:
    description: Every operation must declare at least one tag.
    given: "$.paths.*.*"
    severity: error
    then:
      field: tags
      function: truthy