Home OpenApiDocument Class
OpenApiDocument Class
Cancel

OpenApiDocument Class

Namespace: Json.Schema.Api.OpenApi

Inheritance: OpenApiDocument 🡒 object

Implemented interfaces:

  • IBaseDocument

Models the OpenAPI document.

Properties

NameTypeSummary
ComponentsComponentCollectionGets or sets the components collection.
ExtensionDataExtensionDataGets or set extension data.
ExternalDocsExternalDocumentationGets or sets external documentation.
InfoOpenApiInfoGets the API information.
JsonSchemaDialectUriGets or sets the default JSON Schema dialect.
OpenApistringGets the OpenAPI document version.
PathsPathCollectionGets or sets the paths collection.
SecurityIReadOnlyList<SecurityRequirement>Gets or sets the security requirements collection.
ServersIReadOnlyList<Server>Gets or sets the server collection.
TagsIReadOnlyList<Tag>Gets or sets the tags.
UnknownDataUnknownDataGets or sets properties which are not recognized by OpenAPI.
WebhooksDictionary<string, PathItem>Gets or sets the webhooks collection.

Constructors

OpenApiDocument(string openApi, OpenApiInfo info)

Declaration

1
public OpenApiDocument(string openApi, OpenApiInfo info)
ParameterTypeDescription
openApistringThe OpenAPI version
infoOpenApiInfoThe API information

Methods

Find(JsonPointer pointer)

Finds and retrieves an object within the document at a specified location.

Declaration

1
public T Find(JsonPointer pointer)
ParameterTypeDescription
pointerJsonPointerThe expected location

Returns

The object, if an object of that type exists at that location; otherwise null.

Remarks

The lookup walks the model, so the value found is already a model object. Pointers that land inside extension data or an example value yield a System.Text.Json.Nodes.JsonNode, which is returned only when can hold it.

Initialize(SchemaRegistry schemaRegistry, JsonSerializerOptions options)

Initializes the document model.

Declaration

1
public Task Initialize(SchemaRegistry schemaRegistry, JsonSerializerOptions options)
ParameterTypeDescription
schemaRegistrySchemaRegistry(optional) A schema registry.
optionsJsonSerializerOptions(optional) Serializer options

Returns

Contents