Class OpenApiDocumentExtensions
- Namespace
- TypedRest.CodeGeneration
- Assembly
- TypedRest.CodeGeneration.dll
Provides extension methods for OpenApiDocuments.
public static class OpenApiDocumentExtensions
- Inheritance
-
objectOpenApiDocumentExtensions
Fields
TypedRestKey
The property name used to add TypedRest as an extension to an OpenApiDocument.
public const string TypedRestKey = "x-typedrest"
Field Value
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
documentOpenApiDocumentThe document to get TypedRest data from.
resolveReferencesboolAutomatically runs ResolveReferences(OpenApiComponents) on the endpoints before returning them.
Returns
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
documentOpenApiDocumentThe document to check for patterns.
patternsPatternRegistryAn ordered list of all known IPatterns; leave
nullfor default.
Returns
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
documentOpenApiDocumentendpointEntryEndpoint