-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
ClientGeneratorBaseSettings
Milan Jaroš edited this page Feb 5, 2020
·
18 revisions
- Package: NSwag.CodeGeneration
- Settings for: ClientGeneratorBase
- Class: ClientGeneratorBaseSettings.cs
Common settings for all client code generators.
Properties
- ClassName: The class name of the generated client.
- GenerateDtoTypes: Specifies whether to generate DTO classes.
- GenerateClientInterfaces: Specifies whether generate interfaces for the client classes.
- GenerateClientClasses: Specifies whether generate client classes.
-
OperationNameGenerator
- In the CLI config, there are some predefined modes:
-
OperationGenerationMode: Defines how to generate operations based on the given operation IDs
MultipleClientsFromPathSegments
to generate one client class per controller.-
MultipleClientsFromOperationId (default): Multiple clients from the Swagger operation ID in the form
{controller}_{action}
- MultipleClientsFromPathSegments: Multiple client classes are generated. The method names in the client classes from path segments (operation name = nth segment, client name = nth - 1 segment).
- SingleClientFromOperationId: The method names in the client class are generated from the given Swagger operation ID
-
MultipleClientsFromOperationId (default): Multiple clients from the Swagger operation ID in the form
- GenerateOptionalParameters: Specifies whether to reorder parameters (required first, optional at the end) and generate optional parameters (default: false).
- ParameterNameGenerator
- ExcludedParameterNames: The globally excluded parameter names.
- WrapResponses: Specifies whether to wrap success responses to allow full response access.
- WrapResponseMethods: List of methods where responses are wrapped ('ControllerName.MethodName', WrapResponses must be true).
- GenerateResponseClasses: Specifies whether to generate response classes (default: true).
- ResponseClass: The response class (default 'SwaggerResponse', may use '{controller}' placeholder).
Base settings for: