You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -203,23 +193,24 @@ Various switches enable you to tweak the client generation to your needs. See th
203
193
204
194
# [NSwag](#tab/nswag)
205
195
206
-
The `OpenApiReference` element in the project file accepts an `Options` element to pass additional settings to the client generator,
207
-
which are listed [here](https://github.com/RicoSuter/NSwag/blob/master/src/NSwag.Commands/Commands/CodeGeneration/OpenApiToCSharpClientCommand.cs).
208
-
A guide with common best practices is available [here](https://stevetalkscode.co.uk/openapireference-commands).
196
+
The `OpenApiReference` can be customized using various [NSwag-specific MSBuild properties](https://github.com/RicoSuter/NSwag/blob/7d6df3af95081f3f0ed6dee04be8d27faa86f91a/src/NSwag.ApiDescription.Client/NSwag.ApiDescription.Client.props).
197
+
See [the source code](https://github.com/RicoSuter/NSwag/blob/master/src/NSwag.Commands/Commands/CodeGeneration/OpenApiToCSharpClientCommand.cs) for their meaning.
209
198
210
-
For example, the following section puts the generated code in a namespace and generates an interface (which is handy for dependency injection):
199
+
> [!NOTE]
200
+
> Earlier versions of NSwag required the use of `<Options>` to specify command-line switches directly.
201
+
> This is no longer recommended and may conflict with the new MSBuild properties.
202
+
203
+
For example, the following section puts the generated code in a namespace and generates an interface (handy when writing tests):
Likewise, you can enable nullable reference types by adding `/GenerateNullableReferenceTypes:true /GenerateOptionalPropertiesAsNullable:true /GenerateOptionalParameters:true`.
222
-
223
214
# [Kiota](#tab/kiota)
224
215
225
216
The available command-line switches for Kiota are described [here](https://learn.microsoft.com/en-us/openapi/kiota/using#client-generation).
@@ -257,10 +248,10 @@ The use of HTTP headers varies per client generator. To use [ETags for caching](
257
248
258
249
# [NSwag](#tab/nswag)
259
250
260
-
NSwag needs extra settings to make response headers accessible. Specify the following in the `<Options>` element of your project file:
251
+
To gain access to HTTP response headers, add the following in a `PropertyGroup` or directly in the `OpenApiReference`:
Copy file name to clipboardExpand all lines: src/JsonApiDotNetCore.OpenApi.Swashbuckle/JsonApiObjects/Relationships/NullableToOneRelationshipInResponse.cs
0 commit comments