> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gable.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Check list of data assets for contract violations

> Check list of data assets for contract violations



## OpenAPI

````yaml /api-reference/bundled.yaml post /v0/data-assets/check-compliance
openapi: 3.1.0
info:
  title: Gable API
  description: >
    API to interact with the Gable platform

    ## Authorization

    All API requests require an API key to be passed in the `X-API-KEY` header.
    For instructions on finding your API key and api endpoint check out the [API
    Key documentation](../docs/api-keys.md).

    Example: `curl -H "X-API-KEY: <your-api-key>"
    https://api-{organization}.gable.ai/v0/ping`
  contact:
    name: Gable Engineering
    url: https://gable.ai
    email: engineers@gable.ai
  version: 1.28.0
servers:
  - url: https://{hostname}.gable.ai
    description: Gable API
    variables:
      hostname:
        default: demo-api
        description: Customer environment assigned by Gable
security:
  - ApiKeyAuth: []
tags:
  - name: action
  - name: api-keys
  - name: auth
  - name: changelog
  - name: config
  - name: contract
  - name: data-asset
  - name: debug
  - name: s3
  - name: settings
  - name: slack
  - name: sso
  - name: webhook
  - name: notifications
  - name: constraints
  - name: telemetry
  - name: component
  - name: components
  - name: sca
  - name: cross-service-components
  - name: lineage
  - name: events
  - name: measurements
  - name: defect-report
  - name: experimental
paths:
  /v0/data-assets/check-compliance:
    post:
      tags:
        - data-asset
      summary: Check list of data assets for contract violations
      description: Check list of data assets for contract violations
      operationId: dataAssetsCheckCompliance
      requestBody:
        description: List of data assets to check
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DataAssetsCheckComplianceRequest'
      responses:
        '200':
          description: Data Asset ID
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckDataAssetsResponse'
        '400':
          description: Error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    DataAssetsCheckComplianceRequest:
      type: object
      properties:
        assets:
          description: Array of data assets to check compliance for
          type: array
          items:
            $ref: '#/components/schemas/ResolvedDataAsset'
        includeUnchangedAssets:
          description: >-
            If true, the data assets sent that have not changed compared with
            the stored assets will be checked for contract violations. If false,
            the only data assets that have changed compared with the stored
            assets will be checked for contract violations.
          type: boolean
          default: false
        responseType:
          description: >-
            Determines the format of the response from the API. Specifying
            'DETAILED' will return a detailed JSON object for each data asset
            checked. If 'COMMENT_MARKDOWN' is specified, the response will be a
            markdown string intended to be used as a comment in a pull request.
          type: string
          enum:
            - DETAILED
            - COMMENT_MARKDOWN
        prLink:
          description: >-
            (optional) Link to the pull request the proposed changes to the data
            asset are part of
          type: string
      required:
        - assets
        - responseType
    CheckDataAssetsResponse:
      oneOf:
        - type: array
          items:
            $ref: '#/components/schemas/CheckDataAssetResponse'
        - $ref: '#/components/schemas/CheckDataAssetCommentMarkdownResponse'
    ErrorResponse:
      type: object
      required:
        - message
      properties:
        id:
          type: number
        title:
          type: string
        message:
          type: string
    ResolvedDataAsset:
      type: object
      properties:
        source_type:
          $ref: '#/components/schemas/SourceType'
        data_asset_resource_name:
          $ref: '#/components/schemas/StructuredDataAssetResourceName'
        schema:
          $ref: '#/components/schemas/GableSchemaStruct'
          description: The schema of the data asset
        fieldNameToDataAssetFieldProfileMap:
          $ref: '#/components/schemas/DataAssetFieldsToProfilesMapping'
          description: >-
            A mapping of the field name within the schema to its corresponding
            data profile
      required:
        - source_type
        - data_asset_resource_name
        - schema
    CheckDataAssetResponse:
      oneOf:
        - $ref: '#/components/schemas/CheckDataAssetNoContractResponse'
        - $ref: '#/components/schemas/CheckDataAssetNoChangeResponse'
        - $ref: '#/components/schemas/CheckDataAssetDetailedResponse'
        - $ref: '#/components/schemas/CheckDataAssetErrorResponse'
        - $ref: '#/components/schemas/CheckDataAssetMissingAssetResponse'
      discriminator:
        propertyName: responseType
        mapping:
          NO_CONTRACT:
            $ref: '#/components/schemas/CheckDataAssetNoContractResponse'
          NO_CHANGE:
            $ref: '#/components/schemas/CheckDataAssetNoChangeResponse'
          DETAILED:
            $ref: '#/components/schemas/CheckDataAssetDetailedResponse'
          ERROR:
            $ref: '#/components/schemas/CheckDataAssetErrorResponse'
          MISSING_DATA_ASSET:
            $ref: '#/components/schemas/CheckDataAssetMissingAssetResponse'
    CheckDataAssetCommentMarkdownResponse:
      type: object
      required:
        - responseType
        - shouldAlert
        - shouldBlock
      properties:
        markdown:
          type: string
        shouldAlert:
          description: >-
            Whether or not to comment on the PR - true if at least one contract
            with a contract violation has its enforcement level set to ALERT or
            BLOCK.
          type: boolean
        shouldBlock:
          description: >-
            Whether or not to block the PR - true if at least one contract with
            a contract violation has its enforcement level set to BLOCK.
          type: boolean
        errors:
          type: array
          items:
            $ref: '#/components/schemas/CheckDataAssetErrorResponse'
        responseType:
          type: string
          enum:
            - COMMENT_MARKDOWN
    SourceType:
      type: string
      description: >-
        The type of the source data asset, indicating its source or format
        (e.g., postgres, protobuf).
      enum:
        - postgres
        - mysql
        - mssql
        - json_schema
        - avro
        - protobuf
        - python
        - pyspark
        - typescript
        - java
        - s3
        - dataframe
        - kotlin
        - swift
        - php
        - golang
    StructuredDataAssetResourceName:
      type: object
      properties:
        source_type:
          $ref: '#/components/schemas/SourceType'
        data_source:
          type: string
        path:
          type: string
      required:
        - source_type
        - data_source
        - path
    GableSchemaStruct:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - struct
        name:
          type: string
        fields:
          type: array
          items:
            $ref: '#/components/schemas/GableSchemaField'
        alias:
          type: string
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+$
        doc:
          type: string
        logical:
          type: string
    DataAssetFieldsToProfilesMapping:
      type: object
      description: Mapping of a data asset's fields to their respective data profiles
      additionalProperties:
        $ref: '#/components/schemas/DataAssetFieldProfile'
    CheckDataAssetNoContractResponse:
      type: object
      required:
        - dataAssetNamespace
        - dataAssetResourceName
        - dataAssetPath
        - responseType
      properties:
        dataAssetNamespace:
          description: The namespace of the data asset
          type: string
          examples:
            - postgres://service-one.aaa.eu-west-1.rds.amazonaws.com:5432
            - protobuf://github.com/org/repo/path/to/file.proto
        dataAssetResourceName:
          $ref: '#/components/schemas/DataAssetResourceName'
          description: >-
            The full resource name of the data asset, see [Data
            Assets](https://docs.gable.ai/data_assets_and_lineage/data_assets)
          examples:
            - >-
              postgres://service-one.aaa.eu-west-1.rds.amazonaws.com:5432:serviceone.public.sales
            - >-
              protobuf://git@github.com/org/repo/path/to/file.proto:company.serviceone.Sales
        dataAssetPath:
          description: The relative path of the data asset within its data store
          type: string
          examples:
            - serviceone.public.sales
            - company.serviceone.Sales
        responseType:
          type: string
          enum:
            - NO_CONTRACT
    CheckDataAssetNoChangeResponse:
      type: object
      required:
        - dataAssetNamespace
        - dataAssetResourceName
        - dataAssetPath
        - responseType
      properties:
        dataAssetNamespace:
          description: The namespace of the data asset
          type: string
          examples:
            - postgres://service-one.aaa.eu-west-1.rds.amazonaws.com:5432
            - protobuf://github.com/org/repo/path/to/file.proto
        dataAssetResourceName:
          $ref: '#/components/schemas/DataAssetResourceName'
          description: >-
            The full resource name of the data asset, see [Data
            Assets](https://docs.gable.ai/data_assets_and_lineage/data_assets)
          examples:
            - >-
              postgres://service-one.aaa.eu-west-1.rds.amazonaws.com:5432:serviceone.public.sales
            - >-
              protobuf://git@github.com/org/repo/path/to/file.proto:company.serviceone.Sales
        dataAssetPath:
          description: The relative path of the data asset within its data store
          type: string
          examples:
            - serviceone.public.sales
            - company.serviceone.Sales
        responseType:
          type: string
          enum:
            - NO_CHANGE
    CheckDataAssetDetailedResponse:
      type: object
      required:
        - dataAssetNamespace
        - dataAssetResourceName
        - dataAssetPath
        - contractId
        - contractUrl
        - contractNamespace
        - contractName
        - contractOwner
        - subscribers
        - responseType
      properties:
        dataAssetNamespace:
          description: The namespace of the data asset
          type: string
          examples:
            - postgres://service-one.aaa.eu-west-1.rds.amazonaws.com:5432
            - protobuf://github.com/org/repo/path/to/file.proto
        dataAssetResourceName:
          $ref: '#/components/schemas/DataAssetResourceName'
          description: >-
            The full resource name of the data asset, see [Data
            Assets](https://docs.gable.ai/data_assets_and_lineage/data_assets)
          examples:
            - >-
              postgres://service-one.aaa.eu-west-1.rds.amazonaws.com:5432:serviceone.public.sales
            - >-
              protobuf://git@github.com/org/repo/path/to/file.proto:company.serviceone.Sales
        dataAssetPath:
          description: The relative path of the data asset within its data store
          type: string
          examples:
            - serviceone.public.sales
            - company.serviceone.Sales
        contractId:
          type: string
          format: uuid
        contractUrl:
          description: Link to the contract in the Gable UI
          type: string
        contractNamespace:
          type: string
        contractName:
          type: string
        contractOwner:
          type: string
        contractOwnerGithubHandle:
          type: string
        violations:
          type: array
          items:
            type: object
            required:
              - message
              - field
              - fieldType
              - violationType
              - expected
            properties:
              message:
                type: string
              field:
                type: string
              fieldType:
                type: string
              violationType:
                $ref: '#/components/schemas/ContractViolationType'
              expected:
                type: string
              actual:
                type: string
        subscribers:
          type: array
          items:
            type: object
            properties:
              email:
                type: string
              githubHandle:
                type: string
              slackChannel:
                type: string
        responseType:
          type: string
          enum:
            - DETAILED
        enforcementLevel:
          description: alert level for contract
          type: string
          default: INACTIVE
          enum:
            - RECORD
            - NOTIFY
            - ALERT
            - BLOCK
            - INACTIVE
    CheckDataAssetErrorResponse:
      type: object
      required:
        - dataAssetNamespace
        - message
        - responseType
      properties:
        dataAssetNamespace:
          description: The namespace of the data asset
          type: string
          examples:
            - postgres://service-one.aaa.eu-west-1.rds.amazonaws.com:5432
            - protobuf://github.com/org/repo/path/to/file.proto
        dataAssetResourceName:
          $ref: '#/components/schemas/DataAssetResourceName'
          description: >-
            The full resource name of the data asset, see [Data
            Assets](https://docs.gable.ai/data_assets_and_lineage/data_assets)
          examples:
            - >-
              postgres://service-one.aaa.eu-west-1.rds.amazonaws.com:5432:serviceone.public.sales
            - >-
              protobuf://git@github.com/org/repo/path/to/file.proto:company.serviceone.Sales
        dataAssetPath:
          description: The relative path of the data asset within its data store
          type: string
          examples:
            - serviceone.public.sales
            - company.serviceone.Sales
        message:
          description: The error message
          type: string
        responseType:
          type: string
          enum:
            - ERROR
        enforcementLevel:
          description: notification tier of error response
          type: string
          enum:
            - RECORD
            - NOTIFY
            - ALERT
            - BLOCK
            - INACTIVE
    CheckDataAssetMissingAssetResponse:
      type: object
      required:
        - dataAssetResourceName
        - dataAssetPath
        - contract
        - contractOwner
        - subscribers
        - responseType
      properties:
        dataAssetResourceName:
          $ref: '#/components/schemas/DataAssetResourceName'
          description: >-
            The full resource name of the data asset, see [Data
            Assets](https://docs.gable.ai/data_assets_and_lineage/data_assets)
          examples:
            - >-
              postgres://service-one.aaa.eu-west-1.rds.amazonaws.com:5432:serviceone.public.sales
            - >-
              protobuf://git@github.com/org/repo/path/to/file.proto:company.serviceone.Sales
        dataAssetPath:
          description: The relative path of the data asset within its data store
          type: string
          examples:
            - serviceone.public.sales
            - company.serviceone.Sales
        contract:
          $ref: '#/components/schemas/ContractOutput'
        contractOwner:
          type: string
        contractOwnerGithubHandle:
          type: string
        subscribers:
          type: array
          items:
            type: object
            properties:
              email:
                type: string
              githubHandle:
                type: string
              slackChannel:
                type: string
        responseType:
          type: string
          enum:
            - MISSING_DATA_ASSET
    GableSchemaField:
      oneOf:
        - $ref: '#/components/schemas/GableSchemaFieldStruct'
        - $ref: '#/components/schemas/GableSchemaFieldNull'
        - $ref: '#/components/schemas/GableSchemaFieldBool'
        - $ref: '#/components/schemas/GableSchemaFieldInt'
        - $ref: '#/components/schemas/GableSchemaFieldFloat'
        - $ref: '#/components/schemas/GableSchemaFieldString'
        - $ref: '#/components/schemas/GableSchemaFieldBytes'
        - $ref: '#/components/schemas/GableSchemaFieldList'
        - $ref: '#/components/schemas/GableSchemaFieldMap'
        - $ref: '#/components/schemas/GableSchemaFieldEnum'
        - $ref: '#/components/schemas/GableSchemaFieldUnion'
        - $ref: '#/components/schemas/GableSchemaFieldAliasReference'
        - $ref: '#/components/schemas/GableSchemaFieldUnknown'
      discriminator:
        propertyName: type
        mapping:
          struct:
            $ref: '#/components/schemas/GableSchemaFieldStruct'
          'null':
            $ref: '#/components/schemas/GableSchemaFieldNull'
          bool:
            $ref: '#/components/schemas/GableSchemaFieldBool'
          int:
            $ref: '#/components/schemas/GableSchemaFieldInt'
          float:
            $ref: '#/components/schemas/GableSchemaFieldFloat'
          string:
            $ref: '#/components/schemas/GableSchemaFieldString'
          bytes:
            $ref: '#/components/schemas/GableSchemaFieldBytes'
          list:
            $ref: '#/components/schemas/GableSchemaFieldList'
          map:
            $ref: '#/components/schemas/GableSchemaFieldMap'
          enum:
            $ref: '#/components/schemas/GableSchemaFieldEnum'
          union:
            $ref: '#/components/schemas/GableSchemaFieldUnion'
          aliasReference:
            $ref: '#/components/schemas/GableSchemaFieldAliasReference'
          unknown:
            $ref: '#/components/schemas/GableSchemaFieldUnknown'
    DataAssetFieldProfile:
      oneOf:
        - $ref: '#/components/schemas/DataAssetFieldProfileBoolean'
        - $ref: '#/components/schemas/DataAssetFieldProfileNumber'
        - $ref: '#/components/schemas/DataAssetFieldProfileOther'
        - $ref: '#/components/schemas/DataAssetFieldProfileString'
        - $ref: '#/components/schemas/DataAssetFieldProfileUUID'
        - $ref: '#/components/schemas/DataAssetFieldProfileTemporal'
        - $ref: '#/components/schemas/DataAssetFieldProfileUnion'
        - $ref: '#/components/schemas/DataAssetFieldProfileList'
      discriminator:
        propertyName: profileType
        mapping:
          boolean:
            $ref: '#/components/schemas/DataAssetFieldProfileBoolean'
          number:
            $ref: '#/components/schemas/DataAssetFieldProfileNumber'
          other:
            $ref: '#/components/schemas/DataAssetFieldProfileOther'
          string:
            $ref: '#/components/schemas/DataAssetFieldProfileString'
          uuid:
            $ref: '#/components/schemas/DataAssetFieldProfileUUID'
          temporal:
            $ref: '#/components/schemas/DataAssetFieldProfileTemporal'
          union:
            $ref: '#/components/schemas/DataAssetFieldProfileUnion'
          list:
            $ref: '#/components/schemas/DataAssetFieldProfileList'
    DataAssetResourceName:
      type: string
      pattern: >-
        ^(protobuf|avro|json_schema|java|postgres|mysql|mssql|snowflake|bigquery|python|pyspark|typescript|s3|dataframe|kotlin|swift|php)://(?=.*[a-zA-Z0-9])[a-zA-Z0-9_@\.:/-]+[:/](?=.*[a-zA-Z0-9])[a-zA-Z0-9
        _\./-\{\}\-]+$
      description: >-
        The unique identifier of the data asset. It follows the pattern
        '{data_asset_type}://{data_asset_source}:{data_asset_name}'
    ContractViolationType:
      type: string
      enum:
        - MISSING_REQUIRED_PROPERTY
        - INCOMPATIBLE_TYPE
        - GREATER_THAN
        - GREATER_THAN_OR_EQUAL_TO
        - LESS_THAN
        - LESS_THAN_OR_EQUAL_TO
        - IS_NULL
        - IS_NULL_THRESHOLD
        - IS_NOT_EMPTY
        - LENGTH
        - LENGTH_GREATER_THAN
        - LENGTH_GREATER_THAN_OR_EQUAL_TO
        - LENGTH_LESS_THAN
        - LENGTH_LESS_THAN_OR_EQUAL_TO
        - MISSING_DATA_ASSET
        - PII_DETECTED
    ContractOutput:
      type: object
      required:
        - id
        - status
        - contractSpec
        - contractSpecRaw
        - createdAt
        - updatedAt
        - violations
      properties:
        id:
          description: Unique identifier for the contract in UUID format
          type: string
          format: uuid
        parentRowId:
          description: Unique identifier for a contract's parent row id in UUID format
          type: string
          format: uuid
        version:
          description: Version of the contract (semantic versioning)
          type: string
        status:
          $ref: '#/components/schemas/ContractStatus'
        gitHash:
          description: >-
            full length git hash corresponding to the commit this contract was
            added/updated
          type: string
          minLength: 40
          maxLength: 40
        gitRepo:
          description: full link to the git repo this contract lives in
          type: string
          format: uri
        gitUser:
          description: git user who added/updated this contract
          type: string
        fileUri:
          description: full link to the file in the repo that contains this contract
          type: string
          format: uri
        filePath:
          description: path to the contract file from the root of the git repository
          type: string
        reviewers:
          description: >-
            optional list of users who reviewed the merged PR that this contract
            added/updated in
          type: array
          items:
            type: string
        mergedAt:
          description: >-
            date time at which the PR that added/updated this contract was
            merged
          type: string
          format: date-time
        createdAt:
          description: date time at which the contract was created
          type: string
          format: date-time
        updatedAt:
          description: date time at which the contract was last updated
          type: string
          format: date-time
        contractSpec:
          $ref: '#/components/schemas/ContractSpec'
          description: contract spec
        contractSpecRaw:
          description: contract spec raw json
          type: string
        enforcementLevel:
          description: alert level for contract
          type: string
          default: INACTIVE
          enum:
            - RECORD
            - NOTIFY
            - ALERT
            - BLOCK
            - INACTIVE
        lastEditorUserId:
          description: >-
            Unique identifier for the user who last edited the contract through
            the UI
          type: string
          format: uuid
          nullable: true
        lastEditorEmail:
          description: Email of the user who last edited the contract through the UI
          type: string
          nullable: true
        lastEditorFirstName:
          description: First name of the user who last edited the contract through the UI
          type: string
          nullable: true
        lastEditorLastName:
          description: Last name of the user who last edited the contract through the UI
          type: string
          nullable: true
        lastEditorGithubHandle:
          description: >-
            GitHub handle of the user who last edited the contract through the
            UI
          type: string
          nullable: true
        violations:
          description: List of contract violations
          type: array
          items:
            $ref: '#/components/schemas/ContractViolationEvent'
        contractSpecFieldToViolationStatusMapping:
          description: >-
            Mapping of contract spec fields to a list of the violations
            currently applicable to them
          type: object
          additionalProperties:
            type: array
            items:
              $ref: '#/components/schemas/ContractViolationType'
    GableSchemaFieldStruct:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - struct
        name:
          type: string
        fields:
          type: array
          items:
            $ref: '#/components/schemas/GableSchemaField'
        alias:
          type: string
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+$
        doc:
          type: string
        logical:
          type: string
        optional:
          type: boolean
    GableSchemaFieldNull:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - 'null'
        alias:
          type: string
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+$
        doc:
          type: string
        logical:
          type: string
        name:
          type: string
        optional:
          type: boolean
    GableSchemaFieldBool:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - bool
        alias:
          type: string
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+$
        doc:
          type: string
        logical:
          type: string
        name:
          type: string
        optional:
          type: boolean
    GableSchemaFieldInt:
      type: object
      required:
        - type
        - bits
      properties:
        type:
          type: string
          enum:
            - int
        bits:
          type: integer
          minimum: 1
          maximum: 2147483647
        signed:
          type: boolean
          default: true
        alias:
          type: string
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+$
        doc:
          type: string
        logical:
          $ref: '#/components/schemas/LogicalEnumTemporal'
        unit:
          type: string
          enum:
            - year
            - month
            - day
            - hour
            - minute
            - second
            - millisecond
            - microsecond
            - nanosecond
            - picosecond
        timezone:
          type: string
        name:
          type: string
        optional:
          type: boolean
    GableSchemaFieldFloat:
      type: object
      required:
        - type
        - bits
      properties:
        type:
          type: string
          enum:
            - float
        bits:
          type: integer
          minimum: 1
          maximum: 2147483647
        alias:
          type: string
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+$
        doc:
          type: string
        logical:
          type: string
        name:
          type: string
        optional:
          type: boolean
    GableSchemaFieldString:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - string
        bytes:
          type: integer
          minimum: 1
          maximum: 9223372036854776000
        variable:
          type: boolean
          default: true
        alias:
          type: string
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+$
        doc:
          type: string
        logical:
          $ref: '#/components/schemas/LogicalEnumText'
        name:
          type: string
        optional:
          type: boolean
    GableSchemaFieldBytes:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - bytes
        bytes:
          type: integer
          minimum: 1
          maximum: 9223372036854776000
        variable:
          type: boolean
        alias:
          type: string
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+$
        doc:
          type: string
        logical:
          $ref: '#/components/schemas/LogicalEnumNumeric'
        precision:
          type: integer
          minimum: 1
          maximum: 2147483647
        scale:
          type: integer
          minimum: 0
          maximum: 2147483647
        unit:
          type: string
          enum:
            - year
            - month
            - day
            - hour
            - minute
            - second
            - millisecond
            - microsecond
            - nanosecond
            - picosecond
        name:
          type: string
        optional:
          type: boolean
      if:
        properties:
          variable:
            const: false
        required:
          - variable
      then:
        required:
          - bytes
    GableSchemaFieldList:
      type: object
      required:
        - type
        - values
      properties:
        type:
          type: string
          enum:
            - list
        values:
          $ref: '#/components/schemas/GableSchemaType'
        length:
          type: integer
          minimum: 1
          maximum: 9223372036854776000
        variable:
          type: boolean
          default: true
        alias:
          type: string
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+$
        doc:
          type: string
        name:
          type: string
        optional:
          type: boolean
    GableSchemaFieldMap:
      type: object
      required:
        - type
        - keys
        - values
      properties:
        type:
          type: string
          enum:
            - map
        keys:
          $ref: '#/components/schemas/GableSchemaType'
        values:
          $ref: '#/components/schemas/GableSchemaType'
        alias:
          type: string
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+$
        doc:
          type: string
        logical:
          type: string
        name:
          type: string
        optional:
          type: boolean
    GableSchemaFieldEnum:
      type: object
      required:
        - type
        - symbols
      properties:
        type:
          type: string
          enum:
            - enum
        symbols:
          type: array
          items:
            type: string
        alias:
          type: string
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+$
        doc:
          type: string
        logical:
          type: string
        name:
          type: string
        optional:
          type: boolean
    GableSchemaFieldUnion:
      type: object
      required:
        - type
        - types
      properties:
        type:
          type: string
          enum:
            - union
        types:
          type: array
          items:
            $ref: '#/components/schemas/GableSchemaType'
        alias:
          type: string
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+$
        doc:
          type: string
        logical:
          type: string
        name:
          type: string
        optional:
          type: boolean
    GableSchemaFieldAliasReference:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          not:
            $ref: '#/components/schemas/GableSchemaTypeName'
        doc:
          type: string
        logical:
          type: string
        name:
          type: string
        optional:
          type: boolean
      additionalProperties: true
      not:
        required:
          - alias
    GableSchemaFieldUnknown:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - unknown
        alias:
          type: string
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+$
        doc:
          type: string
        logical:
          type: string
        name:
          type: string
        optional:
          type: boolean
    DataAssetFieldProfileBoolean:
      allOf:
        - $ref: '#/components/schemas/DataAssetFieldProfileBase'
        - type: object
          description: Data asset field profile for boolean
          required:
            - profileType
            - trueCount
            - falseCount
          properties:
            profileType:
              type: string
              enum:
                - boolean
            trueCount:
              type: integer
              description: Number of true values
            falseCount:
              type: integer
              description: Number of false values
    DataAssetFieldProfileNumber:
      allOf:
        - $ref: '#/components/schemas/DataAssetFieldProfileBase'
        - type: object
          description: Data asset field profile for number
          required:
            - profileType
            - uniqueCount
            - min
            - max
          properties:
            profileType:
              type: string
              enum:
                - number
            uniqueCount:
              type: integer
              description: Number of unique values
            min:
              type: number
              description: Minimum value
            max:
              type: number
              description: Maximum value
    DataAssetFieldProfileOther:
      allOf:
        - $ref: '#/components/schemas/DataAssetFieldProfileBase'
        - type: object
          description: Data asset field profile for unspecified type
          required:
            - profileType
          properties:
            profileType:
              type: string
              enum:
                - other
    DataAssetFieldProfileString:
      allOf:
        - $ref: '#/components/schemas/DataAssetFieldProfileBase'
        - type: object
          description: Data asset field profile for string
          required:
            - profileType
            - uniqueCount
            - minLength
            - maxLength
            - emptyCount
          properties:
            profileType:
              type: string
              enum:
                - string
            uniqueCount:
              type: integer
              description: Number of unique values
            minLength:
              type: integer
              description: Minimum length
            maxLength:
              type: integer
              description: Maximum length
            emptyCount:
              type: integer
              description: Number of empty values
    DataAssetFieldProfileUUID:
      allOf:
        - $ref: '#/components/schemas/DataAssetFieldProfileBase'
        - type: object
          description: Data asset field profile for a UUID
          required:
            - profileType
            - uniqueCount
            - minLength
            - maxLength
            - emptyCount
          properties:
            profileType:
              type: string
              enum:
                - uuid
            uniqueCount:
              type: integer
              description: Number of unique values
            minLength:
              type: integer
              description: Minimum length
            maxLength:
              type: integer
              description: Maximum length
            emptyCount:
              type: integer
              description: Number of empty values
            format:
              type: string
              description: UUID format
            uuidVersion:
              type: integer
              description: UUID version
    DataAssetFieldProfileTemporal:
      allOf:
        - $ref: '#/components/schemas/DataAssetFieldProfileBase'
        - type: object
          description: Data asset field profile for temporal
          required:
            - profileType
            - min
            - max
            - format
          properties:
            profileType:
              type: string
              enum:
                - temporal
            min:
              type: string
              format: date-time
              description: Minimum value
            max:
              type: string
              format: date-time
              description: Maximum value
            format:
              type: string
              description: Temporal format
    DataAssetFieldProfileUnion:
      allOf:
        - $ref: '#/components/schemas/DataAssetFieldProfileBase'
        - type: object
          description: Data asset field profile for union
          required:
            - profileType
            - profiles
          properties:
            profileType:
              type: string
              enum:
                - union
            profiles:
              type: array
              description: List of constituent data asset field profiles
              items:
                $ref: '#/components/schemas/DataAssetFieldProfile'
    DataAssetFieldProfileList:
      allOf:
        - $ref: '#/components/schemas/DataAssetFieldProfileBase'
        - type: object
          description: Data asset field profile for string
          required:
            - profileType
            - minLength
            - maxLength
          properties:
            profileType:
              type: string
              enum:
                - list
            minLength:
              type: integer
              description: Minimum length
            maxLength:
              type: integer
              description: Maximum length
    ContractStatus:
      type: string
      description: status of the contract
      enum:
        - ACTIVE
        - DEPRECATED
        - DRAFT
        - ARCHIVED
    ContractSpec:
      type: object
      required:
        - id
        - doc
        - name
        - namespace
        - owner
        - schema
      properties:
        id:
          description: Unique identifier for the contract in UUID format
          type: string
          format: uuid
        dataAssetResourceName:
          $ref: '#/components/schemas/DataAssetResourceName'
        dataAssetResourceNameList:
          type: array
          items:
            $ref: '#/components/schemas/DataAssetResourceName'
          description: >-
            Optional array of data asset resource names for contracts that apply
            to multiple specific assets. When present, this takes precedence
            over dataAssetResourceName.
        doc:
          description: Description of the contract
          type: string
        name:
          description: >-
            The name of the contract. When combined with the contract namespace,
            it represents a unique name in the Gable platform.  Only
            alphanumeric characters (upper and lowercase) and underscores are
            allowed
          type: string
        namespace:
          description: >-
            The namespace of the contract. When combined with the contract name,
            it represents a unique name in the Gable platform.  Only
            alphanumeric characters (upper and lowercase) and underscores are
            allowed
          type: string
        owner:
          description: The owner of the contract
          type: string
          format: email
        restrictPii:
          description: If true, fields that look like PII will cause contract violations.
          type: boolean
        schema:
          type: array
          items:
            $ref: '#/components/schemas/GableSchemaContractField'
    ContractViolationEvent:
      allOf:
        - $ref: '#/components/schemas/ChangelogEventBase'
        - $ref: '#/components/schemas/ContractViolation'
    LogicalEnumTemporal:
      type: string
      enum:
        - Date
        - Time
        - Duration
        - Timestamp
    LogicalEnumText:
      type: string
      enum:
        - UUID
        - org.iso.8601.Date
        - org.iso.8601.DateTime
        - org.iso.8601.Time
    LogicalEnumNumeric:
      type: string
      enum:
        - Decimal
        - Interval
    GableSchemaType:
      oneOf:
        - $ref: '#/components/schemas/GableSchemaTypeName'
        - oneOf:
            - $ref: '#/components/schemas/GableSchemaStruct'
            - $ref: '#/components/schemas/GableSchemaNull'
            - $ref: '#/components/schemas/GableSchemaBool'
            - $ref: '#/components/schemas/GableSchemaInt'
            - $ref: '#/components/schemas/GableSchemaFloat'
            - $ref: '#/components/schemas/GableSchemaString'
            - $ref: '#/components/schemas/GableSchemaBytes'
            - $ref: '#/components/schemas/GableSchemaList'
            - $ref: '#/components/schemas/GableSchemaMap'
            - $ref: '#/components/schemas/GableSchemaEnum'
            - $ref: '#/components/schemas/GableSchemaUnion'
            - $ref: '#/components/schemas/GableSchemaAliasReference'
            - $ref: '#/components/schemas/GableSchemaUnknown'
          discriminator:
            propertyName: type
            mapping:
              struct:
                $ref: '#/components/schemas/GableSchemaStruct'
              'null':
                $ref: '#/components/schemas/GableSchemaNull'
              bool:
                $ref: '#/components/schemas/GableSchemaBool'
              int:
                $ref: '#/components/schemas/GableSchemaInt'
              float:
                $ref: '#/components/schemas/GableSchemaFloat'
              string:
                $ref: '#/components/schemas/GableSchemaString'
              bytes:
                $ref: '#/components/schemas/GableSchemaBytes'
              list:
                $ref: '#/components/schemas/GableSchemaList'
              map:
                $ref: '#/components/schemas/GableSchemaMap'
              enum:
                $ref: '#/components/schemas/GableSchemaEnum'
              union:
                $ref: '#/components/schemas/GableSchemaUnion'
              aliasReference:
                $ref: '#/components/schemas/GableSchemaAliasReference'
              unknown:
                $ref: '#/components/schemas/GableSchemaUnknown'
    GableSchemaTypeName:
      type: string
      enum:
        - 'null'
        - bool
        - int
        - float
        - string
        - bytes
        - list
        - map
        - struct
        - enum
        - union
    DataAssetFieldProfileBase:
      type: object
      description: generic data asset field profile
      required:
        - sampledRecordsCount
        - nullable
        - sampledFiles
        - samplingParameters
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the data asset field profile in UUID format
        sampledRecordsCount:
          type: integer
          description: Number of samples
        nullable:
          type: boolean
          description: Whether the data is nullable
        nullCount:
          type: integer
          description: Number of nulls (only defined if nullable is true)
        sampledFiles:
          type: array
          minItems: 1
          items:
            type: string
          description: List of sampled files
        sampledDate:
          description: The date the sample was taken
          type: string
          format: date-time
        samplingParameters:
          $ref: '#/components/schemas/S3SamplingParameters'
    GableSchemaContractField:
      allOf:
        - oneOf:
            - $ref: '#/components/schemas/GableSchemaStruct'
            - $ref: '#/components/schemas/GableSchemaNull'
            - $ref: '#/components/schemas/GableSchemaBool'
            - $ref: '#/components/schemas/GableSchemaInt'
            - $ref: '#/components/schemas/GableSchemaFloat'
            - $ref: '#/components/schemas/GableSchemaString'
            - $ref: '#/components/schemas/GableSchemaBytes'
            - $ref: '#/components/schemas/GableSchemaList'
            - $ref: '#/components/schemas/GableSchemaMap'
            - $ref: '#/components/schemas/GableSchemaEnum'
            - $ref: '#/components/schemas/GableSchemaUnion'
            - $ref: '#/components/schemas/GableSchemaAliasReference'
            - $ref: '#/components/schemas/GableSchemaUnknown'
        - type: object
          properties:
            name:
              type: string
            optional:
              type: boolean
        - type: object
          properties:
            constraints:
              type: object
              additionalProperties: true
    ChangelogEventBase:
      type: object
      properties:
        id:
          description: The unique identifier for the changelog event.
          type: string
          format: uuid
        eventTitle:
          description: The LLM-generated text of the changelog event.
          type: string
        timestamp:
          description: The timestamp of the changelog event.
          type: string
          format: date-time
        userId:
          description: The unique identifier for the User who made a changelog event.
          type: string
          format: uuid
      required:
        - id
        - entityName
        - timestamp
    ContractViolation:
      type: object
      properties:
        contractId:
          description: Unique identifier for the contract in UUID format
          type: string
          format: uuid
        contractVersion:
          description: Version of the contract
          type: string
        contractFieldName:
          description: Field of the contract where violation occured
          type: string
        contractName:
          description: Name of the contract
          type: string
        contractDomain:
          description: Domain of the contract
          type: string
        dataAssetFieldProfileId:
          description: Unique identifier for the data asset field in UUID format
          type: string
          format: uuid
        entityType:
          description: The type of entity that the changelog event is associated with.
          type: string
          enum:
            - DATA_CONTRACT
        eventType:
          description: The type of event that occurred
          type: string
          enum:
            - VIOLATION
        violationType:
          $ref: '#/components/schemas/ContractViolationType'
          description: Type of violation
        dataAssetResourceName:
          $ref: '#/components/schemas/DataAssetResourceName'
        expectedValue:
          description: Expected value of the field
          type: string
        actualValue:
          description: actual value of the field
          type: string
        userId:
          description: Unique identifier for the user in UUID format
          type: string
          format: uuid
        prLink:
          description: Link to the pull request associated with the violation
          type: string
      required:
        - contractId
        - contractVersion
        - violationType
        - dataAssetResourceName
        - contractFieldName
        - entityType
        - expectedValue
        - actualValue
    GableSchemaNull:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - 'null'
        alias:
          type: string
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+$
        doc:
          type: string
        logical:
          type: string
    GableSchemaBool:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - bool
        alias:
          type: string
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+$
        doc:
          type: string
        logical:
          type: string
    GableSchemaInt:
      type: object
      required:
        - type
        - bits
      properties:
        type:
          type: string
          enum:
            - int
        bits:
          type: integer
          minimum: 1
          maximum: 2147483647
        signed:
          type: boolean
          default: true
        alias:
          type: string
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+$
        doc:
          type: string
        logical:
          $ref: '#/components/schemas/LogicalEnumTemporal'
        unit:
          type: string
          enum:
            - year
            - month
            - day
            - hour
            - minute
            - second
            - millisecond
            - microsecond
            - nanosecond
            - picosecond
        timezone:
          type: string
    GableSchemaFloat:
      type: object
      required:
        - type
        - bits
      properties:
        type:
          type: string
          enum:
            - float
        bits:
          type: integer
          minimum: 1
          maximum: 2147483647
        alias:
          type: string
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+$
        doc:
          type: string
        logical:
          type: string
    GableSchemaString:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - string
        bytes:
          type: integer
          minimum: 1
          maximum: 9223372036854776000
        variable:
          type: boolean
          default: true
        alias:
          type: string
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+$
        doc:
          type: string
        logical:
          $ref: '#/components/schemas/LogicalEnumText'
    GableSchemaBytes:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - bytes
        bytes:
          type: integer
          minimum: 1
          maximum: 9223372036854776000
        variable:
          type: boolean
        alias:
          type: string
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+$
        doc:
          type: string
        logical:
          $ref: '#/components/schemas/LogicalEnumNumeric'
        precision:
          type: integer
          minimum: 1
          maximum: 2147483647
        scale:
          type: integer
          minimum: 0
          maximum: 2147483647
        unit:
          type: string
          enum:
            - year
            - month
            - day
            - hour
            - minute
            - second
            - millisecond
            - microsecond
            - nanosecond
            - picosecond
      if:
        properties:
          variable:
            const: false
        required:
          - variable
      then:
        required:
          - bytes
    GableSchemaList:
      type: object
      required:
        - type
        - values
      properties:
        type:
          type: string
          enum:
            - list
        values:
          $ref: '#/components/schemas/GableSchemaType'
        length:
          type: integer
          minimum: 1
          maximum: 9223372036854776000
        variable:
          type: boolean
          default: true
        alias:
          type: string
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+$
        doc:
          type: string
    GableSchemaMap:
      type: object
      required:
        - type
        - keys
        - values
      properties:
        type:
          type: string
          enum:
            - map
        keys:
          $ref: '#/components/schemas/GableSchemaType'
        values:
          $ref: '#/components/schemas/GableSchemaType'
        alias:
          type: string
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+$
        doc:
          type: string
        logical:
          type: string
    GableSchemaEnum:
      type: object
      required:
        - type
        - symbols
      properties:
        type:
          type: string
          enum:
            - enum
        symbols:
          type: array
          items:
            type: string
        alias:
          type: string
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+$
        doc:
          type: string
        logical:
          type: string
    GableSchemaUnion:
      type: object
      required:
        - type
        - types
      properties:
        type:
          type: string
          enum:
            - union
        types:
          type: array
          items:
            $ref: '#/components/schemas/GableSchemaType'
        alias:
          type: string
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+$
        doc:
          type: string
        logical:
          type: string
    GableSchemaAliasReference:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          not:
            $ref: '#/components/schemas/GableSchemaTypeName'
        doc:
          type: string
        logical:
          type: string
      additionalProperties: true
      not:
        required:
          - alias
    GableSchemaUnknown:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - unknown
        alias:
          type: string
          pattern: ^[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+$
        doc:
          type: string
        logical:
          type: string
    S3SamplingParameters:
      type: object
      description: The parameters used to sample the data
      required:
        - rowSampleCount
      properties:
        rowSampleCount:
          type: integer
          description: Number of rows sampled per file
        recentFileCount:
          type: integer
          description: Number of most recent files whose schemas are sampled per data asset
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````