Table of Contents

Class OpenApiDocumentExtensions

Namespace
TypedRest.CodeGeneration
Assembly
TypedRest.CodeGeneration.dll

Provides extension methods for OpenApiDocuments.

public static class OpenApiDocumentExtensions
Inheritance
object
OpenApiDocumentExtensions

Fields

TypedRestKey

The property name used to add TypedRest as an extension to an OpenApiDocument.

public const string TypedRestKey = "x-typedrest"

Field Value

string

Methods

GetTypedRest(OpenApiDocument, bool)

Gets the TypedRest extension from the OpenAPI Spec document, if present.

public static EntryEndpoint? GetTypedRest(this OpenApiDocument document, bool resolveReferences = true)

Parameters

document OpenApiDocument

The document to get TypedRest data from.

resolveReferences bool

Automatically runs ResolveReferences(OpenApiComponents) on the endpoints before returning them.

Returns

EntryEndpoint

MatchTypedRestPatterns(OpenApiDocument, PatternRegistry?)

Generates an EntryEndpoint with children by matching patterns in the OpenAPI Spec document.

public static EntryEndpoint MatchTypedRestPatterns(this OpenApiDocument document, PatternRegistry? patterns = null)

Parameters

document OpenApiDocument

The document to check for patterns.

patterns PatternRegistry

An ordered list of all known IPatterns; leave null for default.

Returns

EntryEndpoint

SetTypedRest(OpenApiDocument, EntryEndpoint)

Adds the endpoint as a TypedRest extension to the OpenAPI Spec document.

public static OpenApiDocument SetTypedRest(this OpenApiDocument document, EntryEndpoint endpoint)

Parameters

document OpenApiDocument
endpoint EntryEndpoint

Returns

OpenApiDocument