reader
ModuleReaders: one decoded document of one OpenAPI version into a
Specification.
OpenApi2 reads 2.0 (Swagger) documents and OpenApi3 3.0 and 3.1
ones; both build the same canonical model. Schemas are read by a
SchemaReader following the Dialect of the version.
Contents
3 submodules, and what the module defines itself.
use utopia_openapi::Reader;pub trait ReaderReads one document into a Specification.
reader::openapi2
Own pageOpenAPI 2.0 (Swagger).
use utopia_openapi::OpenApi2;pub struct OpenApi2<'a>Reads an OpenAPI 2.0 document: host, basePath and schemes become
servers, definitions the schemas, body and formData parameters a
request body (one media type per consumes), and response schemas one
media type per produces.
reader::openapi3
Own pageOpenAPI 3.0 and 3.1.
use utopia_openapi::OpenApi3;pub struct OpenApi3<'a>Reads an OpenAPI 3.0 or 3.1 document. The minor version only changes
the schema Dialect and whether mutualTLS security
schemes are accepted (3.1).
use utopia_openapi::Dialect;pub struct DialectThe JSON Schema rules an OpenAPI version permits.
Version differences inside schema reading are carried as data here
rather than as branches on Version.
use utopia_openapi::SchemaReader;pub struct SchemaReaderReads raw schema values into the canonical tree.
Depends on nothing but its [Dialect]: schema references are left
unexpanded, so reading never needs the document or a resolver.