{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/datadog-software-catalog/_shared/latest--api.schema.json",
  "description": "Schema for API entities",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/DataDog/schema/main/service-catalog/v3/api.schema.json",
    "sourceSha256": "12fb212333863f59f34e22a61345e5f31749db8b3215839aca573cd89616e0bb"
  },
  "examples": [],
  "allOf": [
    {
      "$ref": "https://catalog.lintel.tools/schemas/schemastore/datadog-software-catalog/_shared/latest--entity.schema.json"
    },
    {
      "type": "object",
      "properties": {
        "apiVersion": {
          "enum": [
            "v3"
          ]
        },
        "kind": {
          "enum": [
            "api"
          ]
        },
        "metadata": {
          "type": "object"
        },
        "extensions": {
          "type": "object"
        },
        "spec": {
          "type": "object",
          "properties": {
            "interface": {
              "type": "object",
              "description": "The API definition",
              "properties": {
                "fileRef": {
                  "type": "string",
                  "description": "The reference to the API definition file",
                  "examples": [
                    "https://github.com/testrepo/openapi.yaml"
                  ],
                  "format": "uri"
                },
                "definition": {
                  "type": "object",
                  "description": "The API definition",
                  "format": "openapi",
                  "properties": {}
                }
              },
              "oneOf": [
                {
                  "required": [
                    "fileRef"
                  ]
                },
                {
                  "required": [
                    "definition"
                  ]
                }
              ],
              "additionalProperties": false
            },
            "lifecycle": {
              "type": "string",
              "description": "The lifecycle state of the component.",
              "examples": [
                "experimental",
                "production",
                "deprecated"
              ],
              "minLength": 1
            },
            "tier": {
              "type": "string",
              "description": "The importance of the component",
              "examples": [
                "1",
                "High"
              ],
              "minLength": 1
            },
            "type": {
              "description": "The type of API",
              "examples": [
                "openapi",
                "graphql",
                "rest",
                "grpc"
              ],
              "type": "string"
            },
            "implementedBy": {
              "description": "Services which implemented the API",
              "examples": [
                "service:apiService"
              ],
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "componentOf": {
              "description": "A list of components the API is a part of",
              "examples": [
                "system:my-example-system",
                "service:myapp"
              ],
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "additionalProperties": false
        },
        "integrations": {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/datadog-software-catalog/_shared/latest--integrations.schema.json"
        },
        "datadog": {
          "type": "object",
          "description": "Datadog product integrations for the API entity",
          "properties": {
            "pipelines": {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/datadog-software-catalog/_shared/latest--datadog_pipelines.schema.json"
            },
            "events": {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/datadog-software-catalog/_shared/latest--datadog_events.schema.json"
            },
            "logs": {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/datadog-software-catalog/_shared/latest--datadog_logs.schema.json"
            },
            "codeLocations": {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/datadog-software-catalog/_shared/latest--datadog_code_locations.schema.json"
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    }
  ]
}
