Module: JSONSchemer::OpenAPI30

Defined in:
lib/json_schemer/openapi30/meta.rb,
lib/json_schemer/openapi30/vocab.rb,
lib/json_schemer/openapi30/document.rb,
lib/json_schemer/openapi30/vocab/base.rb

Defined Under Namespace

Modules: Document, Meta, Vocab

Constant Summary collapse

BASE_URI =
URI('json-schemer://openapi30/schema')
FORMATS =
OpenAPI31::FORMATS.merge(
  'byte' => proc { |instance, _value| ContentEncoding::BASE64.call(instance).first },
  'binary' => proc { |instance, _value| instance.is_a?(String) && instance.encoding == Encoding::BINARY },
  'date' => Format::DATE
)
SCHEMA =
{
  'id' => 'json-schemer://openapi30/schema',
  '$schema' => 'http://json-schema.org/draft-04/schema#',
  'allOf' => [
    { '$ref' => 'http://json-schema.org/draft-04/schema#' },
    {
      'oneOf' => [
        { '$ref' => 'https://spec.openapis.org/oas/3.0/schema/2021-09-28#/definitions/Schema' },
        { '$ref' => 'https://spec.openapis.org/oas/3.0/schema/2021-09-28#/definitions/Reference' }
      ]
    }
  ]
}