Class OpenApiDocumentGenerator
- Namespace
- NSwag.Generation
- Assembly
- NSwag.Generation.dll
Provides services to for Swagger generators like the creation of parameters and handling of schemas.
public class OpenApiDocumentGenerator
- Inheritance
-
OpenApiDocumentGenerator
- Inherited Members
Constructors
OpenApiDocumentGenerator(OpenApiDocumentGeneratorSettings, JsonSchemaResolver)
Initializes a new instance of the OpenApiDocumentGenerator class.
public OpenApiDocumentGenerator(OpenApiDocumentGeneratorSettings settings, JsonSchemaResolver schemaResolver)
Parameters
settings
OpenApiDocumentGeneratorSettingsThe settings.
schemaResolver
JsonSchemaResolverThe schema resolver.
Properties
SchemaGenerator
Gets or sets the schema generator.
public OpenApiSchemaGenerator SchemaGenerator { get; }
Property Value
Methods
CreatePrimitiveParameter(string, ContextualParameterInfo)
Creates a primitive parameter for the given parameter information reflection object.
public OpenApiParameter CreatePrimitiveParameter(string name, ContextualParameterInfo contextualParameter)
Parameters
name
stringThe name.
contextualParameter
ContextualParameterInfoThe parameter.
Returns
- OpenApiParameter
The parameter.
CreatePrimitiveParameter(string, string, ContextualType, bool)
Creates a primitive parameter for the given parameter information reflection object.
public OpenApiParameter CreatePrimitiveParameter(string name, string description, ContextualType contextualParameter, bool enforceNotNull = false)
Parameters
name
stringThe name.
description
stringThe description.
contextualParameter
ContextualTypeType of the parameter.
enforceNotNull
boolSpecifies whether the parameter must never be nullable.
Returns
- OpenApiParameter
The parameter.
CreateUntypedPathParameter(string, string)
Creates a path parameter for a given type.
public OpenApiParameter CreateUntypedPathParameter(string parameterName, string parameterType)
Parameters
Returns
- OpenApiParameter
The parameter.