{
  "type": "object",
  "properties": {
    "docs": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "display-name": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "default-url": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "default-environment": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "environments": {
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/definitions/environments.EnvironmentSchema"
          }
        },
        {
          "type": "null"
        }
      ]
    },
    "auth": {
      "oneOf": [
        {
          "$ref": "#/definitions/auth.ApiAuthSchema"
        },
        {
          "type": "null"
        }
      ]
    },
    "auth-schemes": {
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/definitions/auth.AuthSchemeDeclarationSchema"
          }
        },
        {
          "type": "null"
        }
      ]
    },
    "headers": {
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/definitions/service.HttpHeaderSchema"
          }
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "imports": {
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        {
          "type": "null"
        }
      ]
    },
    "error-discrimination": {
      "oneOf": [
        {
          "$ref": "#/definitions/file.ErrorDiscriminationSchema"
        },
        {
          "type": "null"
        }
      ]
    },
    "audiences": {
      "oneOf": [
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        {
          "type": "null"
        }
      ]
    },
    "errors": {
      "oneOf": [
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        {
          "type": "null"
        }
      ]
    },
    "base-path": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "path-parameters": {
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/definitions/service.HttpPathParameterSchema"
          }
        },
        {
          "type": "null"
        }
      ]
    },
    "idempotency-headers": {
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/definitions/service.HttpHeaderSchema"
          }
        },
        {
          "type": "null"
        }
      ]
    },
    "variables": {
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/definitions/variables.VariableDeclarationSchema"
          }
        },
        {
          "type": "null"
        }
      ]
    },
    "pagination": {
      "oneOf": [
        {
          "$ref": "#/definitions/pagination.PaginationSchema"
        },
        {
          "type": "null"
        }
      ]
    },
    "version": {
      "oneOf": [
        {
          "$ref": "#/definitions/versioning.VersionDeclarationSchema"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "name"
  ],
  "additionalProperties": false,
  "definitions": {
    "environments.SingleBaseUrlEnvironmentSchema": {
      "type": "object",
      "properties": {
        "audiences": {
          "oneOf": [
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            {
              "type": "null"
            }
          ]
        },
        "docs": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "url": {
          "type": "string"
        }
      },
      "required": [
        "url"
      ],
      "additionalProperties": false
    },
    "environments.MultipleBaseUrlsEnvironmentSchema": {
      "type": "object",
      "properties": {
        "audiences": {
          "oneOf": [
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            {
              "type": "null"
            }
          ]
        },
        "docs": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "urls": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        }
      },
      "required": [
        "urls"
      ],
      "additionalProperties": false
    },
    "environments.EnvironmentSchema": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "$ref": "#/definitions/environments.SingleBaseUrlEnvironmentSchema"
        },
        {
          "$ref": "#/definitions/environments.MultipleBaseUrlsEnvironmentSchema"
        }
      ]
    },
    "auth.AuthSchemeReferenceSchema": {
      "type": "object",
      "properties": {
        "docs": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "scheme": {
          "type": "string"
        }
      },
      "required": [
        "scheme"
      ],
      "additionalProperties": false
    },
    "auth.AnyAuthItem": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "$ref": "#/definitions/auth.AuthSchemeReferenceSchema"
        }
      ]
    },
    "auth.AnyAuthSchemesSchema": {
      "type": "object",
      "properties": {
        "docs": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "any": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/auth.AnyAuthItem"
          }
        }
      },
      "required": [
        "any"
      ],
      "additionalProperties": false
    },
    "auth.ApiAuthSchema": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "$ref": "#/definitions/auth.AuthSchemeReferenceSchema"
        },
        {
          "$ref": "#/definitions/auth.AnyAuthSchemesSchema"
        }
      ]
    },
    "auth.OAuthAccessTokenRequestPropertiesSchema": {
      "type": "object",
      "properties": {
        "client-id": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "client-secret": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "scopes": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "auth.OAuthAccessTokenResponsePropertiesSchema": {
      "type": "object",
      "properties": {
        "access-token": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "expires-in": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "refresh-token": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "auth.OAuthGetTokenEndpointSchema": {
      "type": "object",
      "properties": {
        "endpoint": {
          "type": "string"
        },
        "request-properties": {
          "oneOf": [
            {
              "$ref": "#/definitions/auth.OAuthAccessTokenRequestPropertiesSchema"
            },
            {
              "type": "null"
            }
          ]
        },
        "response-properties": {
          "oneOf": [
            {
              "$ref": "#/definitions/auth.OAuthAccessTokenResponsePropertiesSchema"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "endpoint"
      ],
      "additionalProperties": false
    },
    "auth.OAuthRefreshTokenRequestPropertiesSchema": {
      "type": "object",
      "properties": {
        "refresh-token": {
          "type": "string"
        }
      },
      "required": [
        "refresh-token"
      ],
      "additionalProperties": false
    },
    "auth.OAuthRefreshTokenResponsePropertiesSchema": {
      "type": "object",
      "properties": {
        "access-token": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "expires-in": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "refresh-token": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "auth.OAuthRefreshTokenEndpointSchema": {
      "type": "object",
      "properties": {
        "endpoint": {
          "type": "string"
        },
        "request-properties": {
          "oneOf": [
            {
              "$ref": "#/definitions/auth.OAuthRefreshTokenRequestPropertiesSchema"
            },
            {
              "type": "null"
            }
          ]
        },
        "response-properties": {
          "oneOf": [
            {
              "$ref": "#/definitions/auth.OAuthRefreshTokenResponsePropertiesSchema"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "endpoint"
      ],
      "additionalProperties": false
    },
    "auth.OAuthSchemeSchema": {
      "type": "object",
      "properties": {
        "docs": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "scheme": {
          "const": "oauth"
        },
        "type": {
          "const": "client-credentials"
        },
        "scopes": {
          "oneOf": [
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            {
              "type": "null"
            }
          ]
        },
        "client-id-env": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "client-secret-env": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "token-prefix": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "token-header": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "get-token": {
          "$ref": "#/definitions/auth.OAuthGetTokenEndpointSchema"
        },
        "refresh-token": {
          "oneOf": [
            {
              "$ref": "#/definitions/auth.OAuthRefreshTokenEndpointSchema"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "scheme",
        "type",
        "get-token"
      ],
      "additionalProperties": false
    },
    "auth.HeaderAuthSchemeSchema": {
      "type": "object",
      "properties": {
        "env": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "name": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "docs": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "header": {
          "type": "string"
        },
        "type": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "prefix": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "header"
      ],
      "additionalProperties": false
    },
    "auth.AuthVariable": {
      "type": "object",
      "properties": {
        "env": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "name": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "auth.BasicAuthSchemeSchema": {
      "type": "object",
      "properties": {
        "docs": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "scheme": {
          "const": "basic"
        },
        "username": {
          "oneOf": [
            {
              "$ref": "#/definitions/auth.AuthVariable"
            },
            {
              "type": "null"
            }
          ]
        },
        "password": {
          "oneOf": [
            {
              "$ref": "#/definitions/auth.AuthVariable"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "scheme"
      ],
      "additionalProperties": false
    },
    "auth.BearerAuthSchemeSchema": {
      "type": "object",
      "properties": {
        "docs": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "scheme": {
          "const": "bearer"
        },
        "token": {
          "oneOf": [
            {
              "$ref": "#/definitions/auth.AuthVariable"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "scheme"
      ],
      "additionalProperties": false
    },
    "auth.AuthSchemeDeclarationSchema": {
      "anyOf": [
        {
          "$ref": "#/definitions/auth.OAuthSchemeSchema"
        },
        {
          "$ref": "#/definitions/auth.HeaderAuthSchemeSchema"
        },
        {
          "$ref": "#/definitions/auth.BasicAuthSchemeSchema"
        },
        {
          "$ref": "#/definitions/auth.BearerAuthSchemeSchema"
        }
      ]
    },
    "encoding.ProtobufTypeSchema": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        }
      },
      "required": [
        "type"
      ],
      "additionalProperties": false
    },
    "encoding.EncodingSchema": {
      "type": "object",
      "properties": {
        "proto": {
          "oneOf": [
            {
              "$ref": "#/definitions/encoding.ProtobufTypeSchema"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "validation.StringValidationSchema": {
      "type": "object",
      "properties": {
        "minLength": {
          "oneOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "maxLength": {
          "oneOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "pattern": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "format": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "validation.NumberValidationSchema": {
      "type": "object",
      "properties": {
        "min": {
          "oneOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "max": {
          "oneOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "exclusiveMin": {
          "oneOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ]
        },
        "exclusiveMax": {
          "oneOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ]
        },
        "multipleOf": {
          "oneOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "validation.ValidationSchema": {
      "anyOf": [
        {
          "$ref": "#/definitions/validation.StringValidationSchema"
        },
        {
          "$ref": "#/definitions/validation.NumberValidationSchema"
        }
      ]
    },
    "availability.AvailabilityStatusSchema": {
      "type": "string",
      "enum": [
        "in-development",
        "pre-release",
        "deprecated",
        "generally-available"
      ]
    },
    "availability.AvailabilitySchema": {
      "type": "object",
      "properties": {
        "status": {
          "$ref": "#/definitions/availability.AvailabilityStatusSchema"
        },
        "message": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "status"
      ],
      "additionalProperties": false
    },
    "availability.AvailabilityUnionSchema": {
      "anyOf": [
        {
          "$ref": "#/definitions/availability.AvailabilityStatusSchema"
        },
        {
          "$ref": "#/definitions/availability.AvailabilitySchema"
        }
      ]
    },
    "service.TypeReferenceDeclarationWithEnvOverrideSchema": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "default": {
          "oneOf": [
            {
              "type": [
                "string",
                "number",
                "boolean",
                "object",
                "array",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "encoding": {
          "oneOf": [
            {
              "$ref": "#/definitions/encoding.EncodingSchema"
            },
            {
              "type": "null"
            }
          ]
        },
        "validation": {
          "oneOf": [
            {
              "$ref": "#/definitions/validation.ValidationSchema"
            },
            {
              "type": "null"
            }
          ]
        },
        "docs": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "availability": {
          "oneOf": [
            {
              "$ref": "#/definitions/availability.AvailabilityUnionSchema"
            },
            {
              "type": "null"
            }
          ]
        },
        "name": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "audiences": {
          "oneOf": [
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            {
              "type": "null"
            }
          ]
        },
        "env": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "type"
      ],
      "additionalProperties": false
    },
    "service.TypeReferenceDeclarationWithEnvOverride": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "$ref": "#/definitions/service.TypeReferenceDeclarationWithEnvOverrideSchema"
        }
      ]
    },
    "service.HttpHeaderSchema": {
      "$ref": "#/definitions/service.TypeReferenceDeclarationWithEnvOverride"
    },
    "file.PropertyBasedErrorDiscrimination": {
      "type": "object",
      "properties": {
        "strategy": {
          "const": "property"
        },
        "property-name": {
          "type": "string"
        }
      },
      "required": [
        "strategy",
        "property-name"
      ],
      "additionalProperties": false
    },
    "file.StatusCodeBasedErrorDiscrimination": {
      "type": "object",
      "properties": {
        "strategy": {
          "const": "status-code"
        }
      },
      "required": [
        "strategy"
      ],
      "additionalProperties": false
    },
    "file.ErrorDiscriminationSchema": {
      "anyOf": [
        {
          "$ref": "#/definitions/file.PropertyBasedErrorDiscrimination"
        },
        {
          "$ref": "#/definitions/file.StatusCodeBasedErrorDiscrimination"
        }
      ]
    },
    "types.TypeReferenceDetailedSchema": {
      "type": "object",
      "properties": {
        "default": {
          "oneOf": [
            {
              "type": [
                "string",
                "number",
                "boolean",
                "object",
                "array",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "encoding": {
          "oneOf": [
            {
              "$ref": "#/definitions/encoding.EncodingSchema"
            },
            {
              "type": "null"
            }
          ]
        },
        "validation": {
          "oneOf": [
            {
              "$ref": "#/definitions/validation.ValidationSchema"
            },
            {
              "type": "null"
            }
          ]
        },
        "docs": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "availability": {
          "oneOf": [
            {
              "$ref": "#/definitions/availability.AvailabilityUnionSchema"
            },
            {
              "type": "null"
            }
          ]
        },
        "name": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "audiences": {
          "oneOf": [
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            {
              "type": "null"
            }
          ]
        },
        "type": {
          "type": "string"
        }
      },
      "required": [
        "type"
      ],
      "additionalProperties": false
    },
    "types.TypeReferenceSchema": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "$ref": "#/definitions/types.TypeReferenceDetailedSchema"
        }
      ]
    },
    "variables.VariableReferenceSchema": {
      "type": "object",
      "properties": {
        "availability": {
          "oneOf": [
            {
              "$ref": "#/definitions/availability.AvailabilityUnionSchema"
            },
            {
              "type": "null"
            }
          ]
        },
        "docs": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "variable": {
          "type": "string"
        }
      },
      "required": [
        "variable"
      ],
      "additionalProperties": false
    },
    "service.HttpPathParameterSchema": {
      "anyOf": [
        {
          "$ref": "#/definitions/types.TypeReferenceSchema"
        },
        {
          "$ref": "#/definitions/variables.VariableReferenceSchema"
        }
      ]
    },
    "variables.VariableDeclarationDetailed": {
      "type": "object",
      "properties": {
        "docs": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "type": {
          "type": "string"
        }
      },
      "required": [
        "type"
      ],
      "additionalProperties": false
    },
    "variables.VariableDeclarationSchema": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "$ref": "#/definitions/variables.VariableDeclarationDetailed"
        }
      ]
    },
    "pagination.CursorPaginationSchema": {
      "type": "object",
      "properties": {
        "cursor": {
          "type": "string"
        },
        "next_cursor": {
          "type": "string"
        },
        "results": {
          "type": "string"
        }
      },
      "required": [
        "cursor",
        "next_cursor",
        "results"
      ],
      "additionalProperties": false
    },
    "pagination.OffsetPaginationSchema": {
      "type": "object",
      "properties": {
        "offset": {
          "type": "string"
        },
        "results": {
          "type": "string"
        },
        "step": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "has-next-page": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "offset",
        "results"
      ],
      "additionalProperties": false
    },
    "pagination.PaginationSchema": {
      "anyOf": [
        {
          "$ref": "#/definitions/pagination.CursorPaginationSchema"
        },
        {
          "$ref": "#/definitions/pagination.OffsetPaginationSchema"
        }
      ]
    },
    "versioning.VersionValueDetailed": {
      "type": "object",
      "properties": {
        "docs": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "name": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "value": {
          "type": "string"
        }
      },
      "required": [
        "value"
      ],
      "additionalProperties": false
    },
    "versioning.VersionValue": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "$ref": "#/definitions/versioning.VersionValueDetailed"
        }
      ]
    },
    "versioning.VersionDeclarationHeaderObjectSchema": {
      "type": "object",
      "properties": {
        "name": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "env": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "value": {
          "type": "string"
        }
      },
      "required": [
        "value"
      ],
      "additionalProperties": false
    },
    "versioning.VersionDeclarationHeaderSchema": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "$ref": "#/definitions/versioning.VersionDeclarationHeaderObjectSchema"
        }
      ]
    },
    "versioning.VersionDeclarationSchema": {
      "type": "object",
      "properties": {
        "default": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "values": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/versioning.VersionValue"
          }
        },
        "header": {
          "$ref": "#/definitions/versioning.VersionDeclarationHeaderSchema"
        }
      },
      "required": [
        "values",
        "header"
      ],
      "additionalProperties": false
    }
  }
}