Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SC] Create schema for Entity kind "API" #69

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 110 additions & 0 deletions service-catalog/v3/api.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "https://raw.githubusercontent.com/DataDog/schema/main/service-catalog/v3/api.schema.json",
"description": "Schema for API entities",
"examples": [ ],
"allOf": [
{
"$ref": "entity.schema.json"
},
{
"type": "object",
"additionalProperties": false,
"properties": {
"apiVersion": {
"enum": [ "v3" ]
},
"kind": {
"enum": [ "api" ]
},
"metadata": {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a schema for this? If not, we should probably create it

"type": "object"
},
"extensions": {
"type": "object"
},
"spec": {
"type": "object",
"additionalProperties": false,
"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"
}
}
}
},
"integrations": {
"$ref": "integrations.schema.json"
},
"datadog": {
"type": "object",
"description": "Datadog product integrations for the API entity",
"additionalProperties": false,
"properties": {
"performanceData": { "$ref": "datadog_performance.schema.json" },
"pipelines": { "$ref": "datadog_pipelines.schema.json" },
"events": { "$ref": "datadog_events.schema.json" },
"logs": { "$ref": "datadog_logs.schema.json" },
"codeLocations": { "$ref": "datadog_code_locations.schema.json" }
}
}
}
}
]
}