{ "$id": "https://platformatic.dev/schemas/v1.33.0/db", "$schema": "http://json-schema.org/draft-07/schema#", "title": "Platformatic DB", "type": "object", "properties": { "server": { "type": "object", "properties": { "hostname": { "type": "string" }, "port": { "anyOf": [ { "type": "integer" }, { "type": "string" } ] }, "pluginTimeout": { "type": "integer", "default": 60000 }, "healthCheck": { "anyOf": [ { "type": "boolean" }, { "type": "object", "properties": { "enabled": { "type": "boolean" }, "interval": { "type": "integer" } }, "additionalProperties": true } ] }, "ignoreTrailingSlash": { "type": "boolean" }, "ignoreDuplicateSlashes": { "type": "boolean" }, "connectionTimeout": { "type": "integer" }, "keepAliveTimeout": { "type": "integer", "default": 5000 }, "maxRequestsPerSocket": { "type": "integer" }, "forceCloseConnections": { "anyOf": [ { "type": "boolean" }, { "type": "string", "pattern": "^idle$" } ] }, "requestTimeout": { "type": "integer" }, "bodyLimit": { "type": "integer" }, "maxParamLength": { "type": "integer" }, "disableRequestLogging": { "type": "boolean" }, "exposeHeadRoutes": { "type": "boolean" }, "logger": { "anyOf": [ { "type": "boolean" }, { "type": "object", "properties": { "level": { "type": "string" }, "transport": { "anyOf": [ { "type": "object", "properties": { "target": { "type": "string", "resolveModule": true }, "options": { "type": "object" } }, "additionalProperties": false }, { "type": "object", "properties": { "targets": { "type": "array", "items": { "type": "object", "properties": { "target": { "type": "string", "resolveModule": true }, "options": { "type": "object" }, "level": { "type": "string" }, "additionalProperties": false } } }, "options": { "type": "object" } }, "additionalProperties": false } ] }, "pipeline": { "type": "object", "properties": { "target": { "type": "string", "resolveModule": true }, "options": { "type": "object" } }, "additionalProperties": false } }, "additionalProperties": true } ] }, "serializerOpts": { "type": "object", "properties": { "schema": { "type": "object" }, "ajv": { "type": "object" }, "rounding": { "type": "string", "enum": [ "floor", "ceil", "round", "trunc" ], "default": "trunc" }, "debugMode": { "type": "boolean" }, "mode": { "type": "string", "enum": [ "debug", "standalone" ] }, "largeArraySize": { "anyOf": [ { "type": "integer" }, { "type": "string" } ], "default": 20000 }, "largeArrayMechanism": { "type": "string", "enum": [ "default", "json-stringify" ], "default": "default" } } }, "caseSensitive": { "type": "boolean" }, "requestIdHeader": { "anyOf": [ { "type": "string" }, { "type": "boolean", "const": false } ] }, "requestIdLogLabel": { "type": "string" }, "jsonShorthand": { "type": "boolean" }, "trustProxy": { "anyOf": [ { "type": "boolean" }, { "type": "string" }, { "type": "array", "items": { "type": "string" } }, { "type": "integer" } ] }, "https": { "type": "object", "properties": { "key": { "anyOf": [ { "type": "string" }, { "type": "object", "properties": { "path": { "type": "string", "resolvePath": true } }, "additionalProperties": false }, { "type": "array", "items": { "anyOf": [ { "type": "string" }, { "type": "object", "properties": { "path": { "type": "string", "resolvePath": true } }, "additionalProperties": false } ] } } ] }, "cert": { "anyOf": [ { "type": "string" }, { "type": "object", "properties": { "path": { "type": "string", "resolvePath": true } }, "additionalProperties": false }, { "type": "array", "items": { "anyOf": [ { "type": "string" }, { "type": "object", "properties": { "path": { "type": "string", "resolvePath": true } }, "additionalProperties": false } ] } } ] }, "requestCert": { "type": "boolean" }, "rejectUnauthorized": { "type": "boolean" } }, "additionalProperties": false, "required": [ "key", "cert" ] }, "cors": { "type": "object", "$comment": "See https://github.com/fastify/fastify-cors", "properties": { "origin": { "anyOf": [ { "type": "boolean" }, { "type": "string" }, { "type": "array", "items": { "anyOf": [ { "type": "string" }, { "type": "object", "properties": { "regexp": { "type": "string" } }, "required": [ "regexp" ] } ] } }, { "type": "object", "properties": { "regexp": { "type": "string" } }, "required": [ "regexp" ] } ] }, "methods": { "type": "array", "items": { "type": "string" } }, "allowedHeaders": { "type": "string", "description": "Comma separated string of allowed headers." }, "exposedHeaders": { "anyOf": [ { "type": "array", "items": { "type": "string" } }, { "type": "string", "description": "Comma separated string of exposed headers." } ] }, "credentials": { "type": "boolean" }, "maxAge": { "type": "integer" }, "preflightContinue": { "type": "boolean", "default": false }, "optionsSuccessStatus": { "type": "integer", "default": 204 }, "preflight": { "type": "boolean", "default": true }, "strictPreflight": { "type": "boolean", "default": true }, "hideOptionsRoute": { "type": "boolean", "default": true } }, "additionalProperties": false } }, "additionalProperties": false }, "db": { "type": "object", "properties": { "connectionString": { "type": "string" }, "schema": { "type": "array", "items": { "type": "string" } }, "schemalock": { "oneOf": [ { "type": "boolean", "default": false }, { "type": "object", "properties": { "path": { "type": "string", "resolvePath": true } } } ] }, "poolSize": { "type": "integer" }, "idleTimeoutMilliseconds": { "type": "integer" }, "queueTimeoutMilliseconds": { "type": "integer" }, "acquireLockTimeoutMilliseconds": { "type": "integer" }, "autoTimestamp": { "oneOf": [ { "type": "object", "properties": { "createdAt": { "type": "string", "default": "created_at" }, "updatedAt": { "type": "string", "default": "updated_at" } } }, { "type": "boolean" } ] }, "graphql": { "anyOf": [ { "type": "boolean" }, { "type": "object", "properties": { "graphiql": { "type": "boolean" }, "include": { "type": "object", "additionalProperties": { "type": "boolean" } }, "ignore": { "type": "object", "additionalProperties": { "anyOf": [ { "type": "boolean" }, { "type": "object", "additionalProperties": { "type": "boolean" } } ] } }, "subscriptionIgnore": { "type": "array", "items": { "type": "string" } }, "schema": { "type": "string" }, "schemaPath": { "type": "string", "resolvePath": true }, "enabled": { "anyOf": [ { "type": "boolean" }, { "type": "string" } ] } } } ] }, "openapi": { "anyOf": [ { "type": "boolean" }, { "type": "object", "properties": { "info": { "$ref": "#/$defs/info" }, "jsonSchemaDialect": { "type": "string", "default": "https://spec.openapis.org/oas/3.1/dialect/base" }, "servers": { "type": "array", "items": { "$ref": "#/$defs/server" }, "default": [ { "url": "/" } ] }, "paths": { "$ref": "#/$defs/paths" }, "webhooks": { "type": "object", "additionalProperties": { "$ref": "#/$defs/path-item-or-reference" } }, "components": { "$ref": "#/$defs/components" }, "security": { "type": "array", "items": { "$ref": "#/$defs/security-requirement" } }, "tags": { "type": "array", "items": { "$ref": "#/$defs/tag" } }, "externalDocs": { "$ref": "#/$defs/external-documentation" }, "swaggerPrefix": { "type": "string", "description": "Base URL for the OpenAPI Swagger Documentation" }, "path": { "type": "string", "description": "Path to an OpenAPI spec file", "resolvePath": true }, "allowPrimaryKeysInInput": { "type": "boolean", "default": true }, "include": { "type": "object", "additionalProperties": { "type": "boolean" } }, "ignore": { "type": "object", "additionalProperties": { "anyOf": [ { "type": "boolean" }, { "type": "object", "additionalProperties": { "type": "boolean" } } ] } }, "enabled": { "anyOf": [ { "type": "boolean" }, { "type": "string" } ] }, "prefix": { "type": "string", "description": "Base URL for generated Platformatic DB routes" } }, "additionalProperties": false } ] }, "include": { "type": "object", "additionalProperties": { "type": "boolean" } }, "ignore": { "type": "object", "additionalProperties": { "type": "boolean" } }, "limit": { "type": "object", "properties": { "default": { "type": "integer", "default": 10 }, "max": { "type": "integer", "default": 100 } } }, "events": { "anyOf": [ { "type": "boolean" }, { "type": "object", "properties": { "connectionString": { "type": "string" }, "enabled": { "anyOf": [ { "type": "boolean" }, { "type": "string" } ] } }, "additionalProperties": false } ] }, "cache": { "type": "boolean" } }, "required": [ "connectionString" ] }, "authorization": { "type": "object", "properties": { "adminSecret": { "type": "string", "description": "The password should be used to access routes under /_admin prefix and for admin access to REST and GraphQL endpoints with X-PLATFORMATIC-ADMIN-SECRET header." }, "roleKey": { "type": "string", "description": "The user metadata key to store user roles", "default": "X-PLATFORMATIC-ROLE" }, "anonymousRole": { "type": "string", "description": "The role name for anonymous users", "default": "anonymous" }, "jwt": { "type": "object", "additionalProperties": true, "properties": { "secret": { "oneOf": [ { "type": "string", "description": "the shared secret for JWT" }, { "type": "object", "description": "the JWT secret configuration (see: https://github.com/fastify/fastify-jwt#secret-required)", "additionalProperties": true } ] }, "namespace": { "type": "string", "description": "the namespace for JWT custom claims" }, "jwks": { "oneOf": [ { "type": "boolean" }, { "type": "object", "additionalProperties": true } ] } } }, "webhook": { "type": "object", "properties": { "url": { "type": "string", "description": "the webhook url" } }, "additionalProperties": false }, "rules": { "type": "array", "items": { "type": "object", "oneOf": [ { "type": "object", "properties": { "entity": { "type": "string", "description": "the DB entity type to which the rule applies" }, "role": { "type": "string", "description": "the role name to match the rule" }, "defaults": { "type": "object", "description": "defaults for entity creation", "additionalProperties": { "type": "string" } }, "find": { "$ref": "#/$defs/crud-operation-auth" }, "save": { "$ref": "#/$defs/crud-operation-auth" }, "delete": { "$ref": "#/$defs/crud-operation-auth" } }, "required": [ "role" ], "additionalProperties": false }, { "type": "object", "properties": { "entities": { "type": "array", "description": "the DB entity types to which the rule applies", "items": { "type": "string" } }, "role": { "type": "string", "description": "the role name to match the rule" }, "defaults": { "type": "object", "description": "defaults for entity creation", "additionalProperties": { "type": "string" } }, "find": { "$ref": "#/$defs/crud-operation-auth" }, "save": { "$ref": "#/$defs/crud-operation-auth" }, "delete": { "$ref": "#/$defs/crud-operation-auth" } }, "required": [ "role" ], "additionalProperties": false } ] } } }, "additionalProperties": false }, "migrations": { "type": "object", "properties": { "dir": { "type": "string", "resolvePath": true, "description": "The path to the directory containing the migrations." }, "table": { "type": "string", "description": "Table created to track schema version.", "default": "versions" }, "validateChecksums": { "type": "boolean" }, "autoApply": { "description": "Whether to automatically apply migrations when running the migrate command.", "anyOf": [ { "type": "boolean", "default": false }, { "type": "string" } ] }, "newline": { "type": "string", "description": "Force line ending on file when generating checksum. Value should be either CRLF (windows) or LF (unix/mac)." }, "currentSchema": { "type": "string", "description": "For Postgres and MS SQL Server(will ignore for another DBs). Specifies schema to look to when validating `versions` table columns. For Postgres, run's `SET search_path = currentSchema` prior to running queries against db." } }, "additionalProperties": false, "required": [ "dir" ] }, "metrics": { "anyOf": [ { "type": "boolean" }, { "type": "object", "properties": { "port": { "anyOf": [ { "type": "integer" }, { "type": "string" } ] }, "hostname": { "type": "string" }, "endpoint": { "type": "string" }, "server": { "type": "string", "enum": [ "own", "parent", "hide" ] }, "defaultMetrics": { "type": "object", "properties": { "enabled": { "type": "boolean" } }, "required": [ "enabled" ], "additionalProperties": false }, "prefix": { "type": "string" }, "auth": { "type": "object", "properties": { "username": { "type": "string" }, "password": { "type": "string" } }, "additionalProperties": false, "required": [ "username", "password" ] } }, "additionalProperties": false } ] }, "types": { "type": "object", "properties": { "autogenerate": { "type": "boolean" }, "dir": { "type": "string", "resolvePath": true, "description": "The path to the directory the types should be generated in." } }, "additionalProperties": false }, "plugins": { "type": "object", "properties": { "packages": { "type": "array", "items": { "anyOf": [ { "type": "string" }, { "type": "object", "properties": { "name": { "type": "string" }, "options": { "type": "object", "additionalProperties": true } }, "required": [ "name" ] } ] } }, "paths": { "type": "array", "items": { "anyOf": [ { "type": "string", "resolvePath": true }, { "type": "object", "properties": { "path": { "type": "string", "resolvePath": true }, "encapsulate": { "type": "boolean", "default": true }, "maxDepth": { "type": "integer" }, "autoHooks": { "type": "boolean" }, "autoHooksPattern": { "type": "string" }, "cascadeHooks": { "type": "boolean" }, "overwriteHooks": { "type": "boolean" }, "routeParams": { "type": "boolean" }, "forceESM": { "type": "boolean" }, "ignoreFilter": { "type": "string" }, "matchFilter": { "type": "string" }, "ignorePattern": { "type": "string" }, "scriptPattern": { "type": "string" }, "indexPattern": { "type": "string" }, "options": { "type": "object", "additionalProperties": true } } } ] } }, "typescript": { "anyOf": [ { "type": "object", "properties": { "enabled": { "anyOf": [ { "type": "boolean" }, { "type": "string" } ] }, "tsConfig": { "type": "string", "resolvePath": true }, "outDir": { "type": "string", "resolvePath": true }, "flags": { "type": "array", "items": { "type": "string" } } } }, { "type": "boolean" }, { "type": "string" } ] } }, "additionalProperties": false, "anyOf": [ { "required": [ "paths" ] }, { "required": [ "packages" ] } ] }, "telemetry": { "$id": "/OpenTelemetry", "type": "object", "properties": { "serviceName": { "type": "string", "description": "The name of the service. Defaults to the folder name if not specified." }, "version": { "type": "string", "description": "The version of the service (optional)" }, "skip": { "type": "array", "description": "An array of paths to skip when creating spans. Useful for health checks and other endpoints that do not need to be traced.", "items": { "type": "object", "properties": { "path": { "type": "string", "description": "The path to skip. Can be a string or a regex." }, "method": { "description": "HTTP method to skip", "type": "string", "enum": [ "GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS" ] } } } }, "exporter": { "anyOf": [ { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "console", "otlp", "zipkin", "memory" ], "default": "console" }, "options": { "type": "object", "description": "Options for the exporter. These are passed directly to the exporter.", "properties": { "url": { "type": "string", "description": "The URL to send the traces to. Not used for console or memory exporters." }, "headers": { "type": "object", "description": "Headers to send to the exporter. Not used for console or memory exporters." } } }, "additionalProperties": false } } }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "console", "otlp", "zipkin", "memory" ], "default": "console" }, "options": { "type": "object", "description": "Options for the exporter. These are passed directly to the exporter.", "properties": { "url": { "type": "string", "description": "The URL to send the traces to. Not used for console or memory exporters." }, "headers": { "type": "object", "description": "Headers to send to the exporter. Not used for console or memory exporters." } } }, "additionalProperties": false } } ] } }, "required": [ "serviceName" ], "additionalProperties": false }, "clients": { "type": "array", "items": { "type": "object", "properties": { "serviceId": { "type": "string" }, "name": { "type": "string" }, "type": { "type": "string", "enum": [ "openapi", "graphql" ] }, "path": { "type": "string", "resolvePath": true }, "schema": { "type": "string", "resolvePath": true }, "url": { "type": "string" } }, "additionalProperties": false } }, "watch": { "anyOf": [ { "type": "object", "properties": { "enabled": { "default": true, "anyOf": [ { "type": "boolean" }, { "type": "string" } ] }, "allow": { "type": "array", "items": { "type": "string" }, "minItems": 1, "nullable": true, "default": null }, "ignore": { "type": "array", "items": { "type": "string" }, "nullable": true, "default": null } }, "additionalProperties": false }, { "type": "boolean" }, { "type": "string" } ] }, "$schema": { "type": "string" } }, "additionalProperties": false, "required": [ "db" ], "$defs": { "info": { "$comment": "https://spec.openapis.org/oas/v3.1.0#info-object", "type": "object", "properties": { "title": { "type": "string" }, "summary": { "type": "string" }, "description": { "type": "string" }, "termsOfService": { "type": "string" }, "contact": { "$ref": "#/$defs/contact" }, "license": { "$ref": "#/$defs/license" }, "version": { "type": "string" } }, "required": [ "title", "version" ], "$ref": "#/$defs/specification-extensions" }, "contact": { "$comment": "https://spec.openapis.org/oas/v3.1.0#contact-object", "type": "object", "properties": { "name": { "type": "string" }, "url": { "type": "string" }, "email": { "type": "string" } }, "$ref": "#/$defs/specification-extensions" }, "license": { "$comment": "https://spec.openapis.org/oas/v3.1.0#license-object", "type": "object", "properties": { "name": { "type": "string" }, "identifier": { "type": "string" }, "url": { "type": "string" } }, "required": [ "name" ], "$ref": "#/$defs/specification-extensions" }, "server": { "$comment": "https://spec.openapis.org/oas/v3.1.0#server-object", "type": "object", "properties": { "url": { "type": "string" }, "description": { "type": "string" }, "variables": { "type": "object", "additionalProperties": { "$ref": "#/$defs/server-variable" } } }, "required": [ "url" ], "$ref": "#/$defs/specification-extensions" }, "server-variable": { "$comment": "https://spec.openapis.org/oas/v3.1.0#server-variable-object", "type": "object", "properties": { "enum": { "type": "array", "items": { "type": "string" }, "minItems": 1 }, "default": { "type": "string" }, "description": { "type": "string" } }, "required": [ "default" ], "$ref": "#/$defs/specification-extensions" }, "components": { "$comment": "https://spec.openapis.org/oas/v3.1.0#components-object", "type": "object", "properties": { "schemas": { "type": "object" }, "responses": { "type": "object", "additionalProperties": { "$ref": "#/$defs/response-or-reference" } }, "parameters": { "type": "object", "additionalProperties": { "$ref": "#/$defs/parameter-or-reference" } }, "examples": { "type": "object", "additionalProperties": { "$ref": "#/$defs/example-or-reference" } }, "requestBodies": { "type": "object", "additionalProperties": { "$ref": "#/$defs/request-body-or-reference" } }, "headers": { "type": "object", "additionalProperties": { "$ref": "#/$defs/header-or-reference" } }, "securitySchemes": { "type": "object", "additionalProperties": { "$ref": "#/$defs/security-scheme-or-reference" } }, "links": { "type": "object", "additionalProperties": { "$ref": "#/$defs/link-or-reference" } }, "callbacks": { "type": "object", "additionalProperties": { "$ref": "#/$defs/callbacks-or-reference" } }, "pathItems": { "type": "object", "additionalProperties": { "$ref": "#/$defs/path-item-or-reference" } } }, "$ref": "#/$defs/specification-extensions" }, "paths": { "$comment": "https://spec.openapis.org/oas/v3.1.0#paths-object", "type": "object", "patternProperties": { "^/": { "$ref": "#/$defs/path-item" } }, "$ref": "#/$defs/specification-extensions" }, "path-item": { "$comment": "https://spec.openapis.org/oas/v3.1.0#path-item-object", "type": "object", "properties": { "summary": { "type": "string" }, "description": { "type": "string" }, "servers": { "type": "array", "items": { "$ref": "#/$defs/server" } }, "parameters": { "type": "array", "items": { "$ref": "#/$defs/parameter-or-reference" } }, "get": { "$ref": "#/$defs/operation" }, "put": { "$ref": "#/$defs/operation" }, "post": { "$ref": "#/$defs/operation" }, "delete": { "$ref": "#/$defs/operation" }, "options": { "$ref": "#/$defs/operation" }, "head": { "$ref": "#/$defs/operation" }, "patch": { "$ref": "#/$defs/operation" }, "trace": { "$ref": "#/$defs/operation" } }, "$ref": "#/$defs/specification-extensions" }, "path-item-or-reference": { "if": { "type": "object", "required": [ "$ref" ] }, "then": { "$ref": "#/$defs/reference" }, "else": { "$ref": "#/$defs/path-item" } }, "operation": { "$comment": "https://spec.openapis.org/oas/v3.1.0#operation-object", "type": "object", "properties": { "tags": { "type": "array", "items": { "type": "string" } }, "summary": { "type": "string" }, "description": { "type": "string" }, "externalDocs": { "$ref": "#/$defs/external-documentation" }, "operationId": { "type": "string" }, "parameters": { "type": "array", "items": { "$ref": "#/$defs/parameter-or-reference" } }, "requestBody": { "$ref": "#/$defs/request-body-or-reference" }, "responses": { "$ref": "#/$defs/responses" }, "callbacks": { "type": "object", "additionalProperties": { "$ref": "#/$defs/callbacks-or-reference" } }, "security": { "type": "array", "items": { "$ref": "#/$defs/security-requirement" } }, "servers": { "type": "array", "items": { "$ref": "#/$defs/server" } } }, "$ref": "#/$defs/specification-extensions" }, "external-documentation": { "$comment": "https://spec.openapis.org/oas/v3.1.0#external-documentation-object", "type": "object", "properties": { "description": { "type": "string" }, "url": { "type": "string" } }, "required": [ "url" ], "$ref": "#/$defs/specification-extensions" }, "parameter": { "$comment": "https://spec.openapis.org/oas/v3.1.0#parameter-object", "type": "object", "properties": { "name": { "type": "string" }, "in": { "enum": [ "query", "header", "path", "cookie" ] }, "description": { "type": "string" }, "required": { "default": false, "type": "boolean" }, "content": { "type": "object", "$ref": "#/$defs/content", "minProperties": 1, "maxProperties": 1 } }, "required": [ "name", "in" ], "oneOf": [ { "required": [ "schema" ] }, { "required": [ "content" ] } ], "if": { "type": "object", "properties": { "in": { "const": "query" } }, "required": [ "in" ] }, "then": { "type": "object", "properties": { "allowEmptyValue": { "default": false, "type": "boolean" } } }, "$ref": "#/$defs/specification-extensions" }, "parameter-or-reference": { "if": { "type": "object", "required": [ "$ref" ] }, "then": { "$ref": "#/$defs/reference" }, "else": { "$ref": "#/$defs/parameter" } }, "request-body": { "$comment": "https://spec.openapis.org/oas/v3.1.0#request-body-object", "type": "object", "properties": { "description": { "type": "string" }, "content": { "$ref": "#/$defs/content" }, "required": { "default": false, "type": "boolean" } }, "required": [ "content" ], "$ref": "#/$defs/specification-extensions" }, "request-body-or-reference": { "if": { "type": "object", "required": [ "$ref" ] }, "then": { "$ref": "#/$defs/reference" }, "else": { "$ref": "#/$defs/request-body" } }, "content": { "$comment": "https://spec.openapis.org/oas/v3.1.0#fixed-fields-10", "type": "object", "additionalProperties": { "$ref": "#/$defs/media-type" } }, "media-type": { "$comment": "https://spec.openapis.org/oas/v3.1.0#media-type-object", "type": "object", "properties": { "encoding": { "type": "object", "additionalProperties": { "$ref": "#/$defs/encoding" } } }, "allOf": [ { "$ref": "#/$defs/specification-extensions" }, { "$ref": "#/$defs/examples" } ] }, "encoding": { "$comment": "https://spec.openapis.org/oas/v3.1.0#encoding-object", "type": "object", "properties": { "contentType": { "type": "string" }, "headers": { "type": "object", "additionalProperties": { "$ref": "#/$defs/header-or-reference" } }, "style": { "default": "form", "enum": [ "form", "spaceDelimited", "pipeDelimited", "deepObject" ] }, "explode": { "type": "boolean" }, "allowReserved": { "default": false, "type": "boolean" } }, "allOf": [ { "$ref": "#/$defs/specification-extensions" }, { "$ref": "#/$defs/encoding/$defs/explode-default" } ], "$defs": { "explode-default": { "if": { "type": "object", "properties": { "style": { "const": "form" } }, "required": [ "style" ] }, "then": { "type": "object", "properties": { "explode": { "default": true } } }, "else": { "type": "object", "properties": { "explode": { "default": false } } } } } }, "responses": { "$comment": "https://spec.openapis.org/oas/v3.1.0#responses-object", "type": "object", "additionalProperties": { "$ref": "#/$defs/response-or-reference" }, "minProperties": 1, "$ref": "#/$defs/specification-extensions" }, "response": { "$comment": "https://spec.openapis.org/oas/v3.1.0#response-object", "type": "object", "properties": { "description": { "type": "string" }, "headers": { "type": "object", "additionalProperties": { "$ref": "#/$defs/header-or-reference" } }, "content": { "$ref": "#/$defs/content" }, "links": { "type": "object", "additionalProperties": { "$ref": "#/$defs/link-or-reference" } } }, "required": [ "description" ], "$ref": "#/$defs/specification-extensions" }, "response-or-reference": { "if": { "type": "object", "required": [ "$ref" ] }, "then": { "$ref": "#/$defs/reference" }, "else": { "$ref": "#/$defs/response" } }, "callbacks": { "$comment": "https://spec.openapis.org/oas/v3.1.0#callback-object", "type": "object", "$ref": "#/$defs/specification-extensions", "additionalProperties": { "$ref": "#/$defs/path-item-or-reference" } }, "callbacks-or-reference": { "if": { "type": "object", "required": [ "$ref" ] }, "then": { "$ref": "#/$defs/reference" }, "else": { "$ref": "#/$defs/callbacks" } }, "example": { "$comment": "https://spec.openapis.org/oas/v3.1.0#example-object", "type": "object", "properties": { "summary": { "type": "string" }, "description": { "type": "string" }, "value": true, "externalValue": { "type": "string" } }, "not": { "required": [ "value", "externalValue" ] }, "$ref": "#/$defs/specification-extensions" }, "example-or-reference": { "if": { "type": "object", "required": [ "$ref" ] }, "then": { "$ref": "#/$defs/reference" }, "else": { "$ref": "#/$defs/example" } }, "link": { "$comment": "https://spec.openapis.org/oas/v3.1.0#link-object", "type": "object", "properties": { "operationRef": { "type": "string" }, "operationId": { "type": "string" }, "parameters": { "$ref": "#/$defs/map-of-strings" }, "requestBody": true, "description": { "type": "string" }, "body": { "$ref": "#/$defs/server" } }, "oneOf": [ { "required": [ "operationRef" ] }, { "required": [ "operationId" ] } ], "$ref": "#/$defs/specification-extensions" }, "link-or-reference": { "if": { "type": "object", "required": [ "$ref" ] }, "then": { "$ref": "#/$defs/reference" }, "else": { "$ref": "#/$defs/link" } }, "header": { "$comment": "https://spec.openapis.org/oas/v3.1.0#header-object", "type": "object", "properties": { "description": { "type": "string" }, "required": { "default": false, "type": "boolean" }, "content": { "type": "object", "$ref": "#/$defs/content", "minProperties": 1, "maxProperties": 1 } }, "oneOf": [ { "required": [ "schema" ] }, { "required": [ "content" ] } ], "$ref": "#/$defs/specification-extensions" }, "header-or-reference": { "if": { "type": "object", "required": [ "$ref" ] }, "then": { "$ref": "#/$defs/reference" }, "else": { "$ref": "#/$defs/header" } }, "tag": { "$comment": "https://spec.openapis.org/oas/v3.1.0#tag-object", "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "externalDocs": { "$ref": "#/$defs/external-documentation" } }, "required": [ "name" ], "$ref": "#/$defs/specification-extensions" }, "reference": { "$comment": "https://spec.openapis.org/oas/v3.1.0#reference-object", "type": "object", "properties": { "$ref": { "type": "string" }, "summary": { "type": "string" }, "description": { "type": "string" } } }, "schema": { "$comment": "https://spec.openapis.org/oas/v3.1.0#schema-object", "type": [ "object", "boolean" ] }, "security-scheme": { "$comment": "https://spec.openapis.org/oas/v3.1.0#security-scheme-object", "type": "object", "properties": { "type": { "enum": [ "apiKey", "http", "mutualTLS", "oauth2", "openIdConnect" ] }, "description": { "type": "string" } }, "required": [ "type" ], "allOf": [ { "$ref": "#/$defs/specification-extensions" }, { "$ref": "#/$defs/security-scheme/$defs/type-apikey" }, { "$ref": "#/$defs/security-scheme/$defs/type-http" }, { "$ref": "#/$defs/security-scheme/$defs/type-http-bearer" }, { "$ref": "#/$defs/security-scheme/$defs/type-oauth2" }, { "$ref": "#/$defs/security-scheme/$defs/type-oidc" } ], "$defs": { "type-apikey": { "if": { "type": "object", "properties": { "type": { "const": "apiKey" } }, "required": [ "type" ] }, "then": { "type": "object", "properties": { "name": { "type": "string" }, "in": { "enum": [ "query", "header", "cookie" ] } }, "required": [ "name", "in" ] } }, "type-http": { "if": { "type": "object", "properties": { "type": { "const": "http" } }, "required": [ "type" ] }, "then": { "type": "object", "properties": { "scheme": { "type": "string" } }, "required": [ "scheme" ] } }, "type-http-bearer": { "if": { "type": "object", "properties": { "type": { "const": "http" }, "scheme": { "type": "string", "pattern": "^[Bb][Ee][Aa][Rr][Ee][Rr]$" } }, "required": [ "type", "scheme" ] }, "then": { "type": "object", "properties": { "bearerFormat": { "type": "string" } } } }, "type-oauth2": { "if": { "type": "object", "properties": { "type": { "const": "oauth2" } }, "required": [ "type" ] }, "then": { "type": "object", "properties": { "flows": { "$ref": "#/$defs/oauth-flows" } }, "required": [ "flows" ] } }, "type-oidc": { "if": { "type": "object", "properties": { "type": { "const": "openIdConnect" } }, "required": [ "type" ] }, "then": { "type": "object", "properties": { "openIdConnectUrl": { "type": "string" } }, "required": [ "openIdConnectUrl" ] } } } }, "security-scheme-or-reference": { "if": { "type": "object", "required": [ "$ref" ] }, "then": { "$ref": "#/$defs/reference" }, "else": { "$ref": "#/$defs/security-scheme" } }, "oauth-flows": { "type": "object", "properties": { "implicit": { "$ref": "#/$defs/oauth-flows/$defs/implicit" }, "password": { "$ref": "#/$defs/oauth-flows/$defs/password" }, "clientCredentials": { "$ref": "#/$defs/oauth-flows/$defs/client-credentials" }, "authorizationCode": { "$ref": "#/$defs/oauth-flows/$defs/authorization-code" } }, "$ref": "#/$defs/specification-extensions", "$defs": { "implicit": { "type": "object", "properties": { "authorizationUrl": { "type": "string" }, "refreshUrl": { "type": "string" }, "scopes": { "$ref": "#/$defs/map-of-strings" } }, "required": [ "authorizationUrl", "scopes" ], "$ref": "#/$defs/specification-extensions" }, "password": { "type": "object", "properties": { "tokenUrl": { "type": "string" }, "refreshUrl": { "type": "string" }, "scopes": { "$ref": "#/$defs/map-of-strings" } }, "required": [ "tokenUrl", "scopes" ], "$ref": "#/$defs/specification-extensions" }, "client-credentials": { "type": "object", "properties": { "tokenUrl": { "type": "string" }, "refreshUrl": { "type": "string" }, "scopes": { "$ref": "#/$defs/map-of-strings" } }, "required": [ "tokenUrl", "scopes" ], "$ref": "#/$defs/specification-extensions" }, "authorization-code": { "type": "object", "properties": { "authorizationUrl": { "type": "string" }, "tokenUrl": { "type": "string" }, "refreshUrl": { "type": "string" }, "scopes": { "$ref": "#/$defs/map-of-strings" } }, "required": [ "authorizationUrl", "tokenUrl", "scopes" ], "$ref": "#/$defs/specification-extensions" } } }, "security-requirement": { "$comment": "https://spec.openapis.org/oas/v3.1.0#security-requirement-object", "type": "object", "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "specification-extensions": { "$comment": "https://spec.openapis.org/oas/v3.1.0#specification-extensions", "type": "object", "patternProperties": { "^x-": true } }, "examples": { "type": "object", "properties": { "example": true, "examples": { "type": "object", "additionalProperties": { "$ref": "#/$defs/example-or-reference" } } } }, "map-of-strings": { "type": "object", "additionalProperties": { "type": "string" } }, "crud-operation-auth": { "oneOf": [ { "type": "object", "description": "CRUD operation authorization config", "properties": { "checks": { "description": "checks for the operation", "type": "object", "additionalProperties": { "if": { "type": "object" }, "then": { "type": "object", "properties": { "eq": { "type": "string" }, "in": { "type": "string" }, "nin": { "type": "string" }, "nen": { "type": "string" }, "gt": { "type": "string" }, "gte": { "type": "string" }, "lt": { "type": "string" }, "lte": { "type": "string" } }, "additionalProperties": false }, "else": { "type": "string" } } }, "fields": { "type": "array", "description": "array of enabled field for the operation", "items": { "type": "string" } } }, "additionalProperties": false }, { "type": "boolean", "description": "true if enabled (with not authorization constraints enabled)" } ] } } }