@@ -197,67 +197,84 @@ These packages are provided by the open-source community.
197
197
198
198
The steps described above will get you up and running with minimal setup. However, Swashbuckle offers a lot of flexibility to customize as you see fit. Check out the table below for the full list of options:
199
199
200
- * [ Swashbuckle.AspNetCore.Swagger] ( #swashbuckleaspnetcoreswagger )
201
-
202
- * [ Change the Path for Swagger JSON Endpoints] ( #change-the-path-for-swagger-json-endpoints )
203
- * [ Modify Swagger with Request Context] ( #modify-swagger-with-request-context )
204
- * [ Serialize Swagger JSON in the 2.0 format] ( #serialize-swagger-in-the-20-format )
205
- * [ Working with Virtual Directories and Reverse Proxies] ( #working-with-virtual-directories-and-reverse-proxies )
206
- * [ Customizing how the OpenAPI document is serialized] ( #customizing-how-the-openapi-document-is-serialized )
207
-
208
- * [ Swashbuckle.AspNetCore.SwaggerGen] ( #swashbuckleaspnetcoreswaggergen )
209
-
210
- * [ Assign Explicit OperationIds] ( #assign-explicit-operationids )
211
- * [ List Operations Responses] ( #list-operation-responses )
212
- * [ Flag Required Parameters and Schema Properties] ( #flag-required-parameters-and-schema-properties )
213
- * [ Handle Forms and File Uploads] ( #handle-forms-and-file-uploads )
214
- * [ Handle File Downloads] ( #handle-file-downloads )
215
- * [ Include Descriptions from XML Comments] ( #include-descriptions-from-xml-comments )
216
- * [ Provide Global API Metadata] ( #provide-global-api-metadata )
217
- * [ Generate Multiple Swagger Documents] ( #generate-multiple-swagger-documents )
218
- * [ Omit Obsolete Operations and/or Schema Properties] ( #omit-obsolete-operations-andor-schema-properties )
219
- * [ Omit Arbitrary Operations] ( #omit-arbitrary-operations )
220
- * [ Customize Operation Tags (e.g. for UI Grouping)] ( #customize-operation-tags-eg-for-ui-grouping )
221
- * [ Change Operation Sort Order (e.g. for UI Sorting)] ( #change-operation-sort-order-eg-for-ui-sorting )
222
- * [ Customize Schema Id's] ( #customize-schema-ids )
223
- * [ Override Schema for Specific Types] ( #override-schema-for-specific-types )
224
- * [ Extend Generator with Operation, Schema & Document Filters] ( #extend-generator-with-operation-schema--document-filters )
225
- * [ Add Security Definitions and Requirements] ( #add-security-definitions-and-requirements )
226
- * [ Add Security Definitions and Requirements for Bearer auth] ( #add-security-definitions-and-requirements-for-bearer-auth )
227
- * [ Inheritance and Polymorphism] ( #inheritance-and-polymorphism )
228
-
229
- * [ Swashbuckle.AspNetCore.SwaggerUI] ( #swashbuckleaspnetcoreswaggerui )
230
- * [ Change Relative Path to the UI] ( #change-relative-path-to-the-ui )
231
- * [ Change Document Title] ( #change-document-title )
232
- * [ Change CSS or JS Paths] ( #change-css-or-js-paths )
233
- * [ List Multiple Swagger Documents] ( #list-multiple-swagger-documents )
234
- * [ Apply swagger-ui Parameters] ( #apply-swagger-ui-parameters )
235
- * [ Inject Custom JavaScript] ( #inject-custom-javascript )
236
- * [ Inject Custom CSS] ( #inject-custom-css )
237
- * [ Customize index.html] ( #customize-indexhtml )
238
- * [ Enable OAuth2.0 Flows] ( #enable-oauth20-flows )
239
- * [ Use client-side request and response interceptors] ( #use-client-side-request-and-response-interceptors )
240
-
241
- * [ Swashbuckle.AspNetCore.Annotations] ( #swashbuckleaspnetcoreannotations )
242
- * [ Install and Enable Annotations] ( #install-and-enable-annotations )
243
- * [ Enrich Operation Metadata] ( #enrich-operation-metadata )
244
- * [ Enrich Response Metadata] ( #enrich-response-metadata )
245
- * [ Enrich Parameter Metadata] ( #enrich-parameter-metadata )
246
- * [ Enrich RequestBody Metadata] ( #enrich-requestbody-metadata )
247
- * [ Enrich Schema Metadata] ( #enrich-schema-metadata )
248
- * [ Apply Schema Filters to Specific Types] ( #apply-schema-filters-to-specific-types )
249
- * [ Add Tag Metadata] ( #add-tag-metadata )
250
-
251
- * [ Swashbuckle.AspNetCore.Cli] ( #swashbuckleaspnetcorecli )
252
- * [ Retrieve Swagger Directly from a Startup Assembly] ( #retrieve-swagger-directly-from-a-startup-assembly )
253
- * [ Use the CLI Tool with a Custom Host Configuration] ( #use-the-cli-tool-with-a-custom-host-configuration )
254
-
255
- * [ Swashbuckle.AspNetCore.ReDoc] ( #swashbuckleaspnetcoreredoc )
256
- * [ Change Relative Path to the UI] ( #redoc-change-relative-path-to-the-ui )
257
- * [ Change Document Title] ( #redoc-change-document-title )
258
- * [ Apply Redoc Parameters] ( #apply-redoc-parameters )
259
- * [ Inject Custom CSS] ( #redoc-inject-custom-css )
260
- * [ Customize index.html] ( #redoc-customize-indexhtml )
200
+ - [ Swashbuckle.AspNetCore] ( #swashbuckleaspnetcore )
201
+ - [ Compatibility] ( #compatibility )
202
+ - [ Getting Started] ( #getting-started )
203
+ - [ System.Text.Json (STJ) vs Newtonsoft] ( #systemtextjson-stj-vs-newtonsoft )
204
+ - [ Swashbuckle, ApiExplorer, and Routing] ( #swashbuckle-apiexplorer-and-routing )
205
+ - [ Components] ( #components )
206
+ - [ "Core" Packages (i.e. installed via Swashbuckle.AspNetCore)] ( #core-packages-ie-installed-via-swashbuckleaspnetcore )
207
+ - [ Additional Packages] ( #additional-packages )
208
+ - [ Community Packages] ( #community-packages )
209
+ - [ Configuration \& Customization] ( #configuration--customization )
210
+ - [ Swashbuckle.AspNetCore.Swagger] ( #swashbuckleaspnetcoreswagger )
211
+ - [ Change the Path for Swagger JSON Endpoints] ( #change-the-path-for-swagger-json-endpoints )
212
+ - [ Modify Swagger with Request Context] ( #modify-swagger-with-request-context )
213
+ - [ Serialize Swagger in the 2.0 format] ( #serialize-swagger-in-the-20-format )
214
+ - [ Working with Virtual Directories and Reverse Proxies] ( #working-with-virtual-directories-and-reverse-proxies )
215
+ - [ Customizing how the OpenAPI document is serialized] ( #customizing-how-the-openapi-document-is-serialized )
216
+ - [ Swashbuckle.AspNetCore.SwaggerGen] ( #swashbuckleaspnetcoreswaggergen )
217
+ - [ Assign Explicit OperationIds] ( #assign-explicit-operationids )
218
+ - [ List Operation Responses] ( #list-operation-responses )
219
+ - [ Explicit Responses] ( #explicit-responses )
220
+ - [ Flag Required Parameters and Schema Properties] ( #flag-required-parameters-and-schema-properties )
221
+ - [ Handle Forms and File Uploads] ( #handle-forms-and-file-uploads )
222
+ - [ Handle File Downloads] ( #handle-file-downloads )
223
+ - [ Include Descriptions from XML Comments] ( #include-descriptions-from-xml-comments )
224
+ - [ Provide Global API Metadata] ( #provide-global-api-metadata )
225
+ - [ Generate Multiple Swagger Documents] ( #generate-multiple-swagger-documents )
226
+ - [ Decorate Individual Actions] ( #decorate-individual-actions )
227
+ - [ Assign Actions to Documents by Convention] ( #assign-actions-to-documents-by-convention )
228
+ - [ Customize the Action Selection Process] ( #customize-the-action-selection-process )
229
+ - [ Exposing Multiple Documents through the UI] ( #exposing-multiple-documents-through-the-ui )
230
+ - [ Omit Obsolete Operations and/or Schema Properties] ( #omit-obsolete-operations-andor-schema-properties )
231
+ - [ Omit Arbitrary Operations] ( #omit-arbitrary-operations )
232
+ - [ Decorate Individual Actions] ( #decorate-individual-actions-1 )
233
+ - [ Omit Actions by Convention] ( #omit-actions-by-convention )
234
+ - [ Customize Operation Tags (e.g. for UI Grouping)] ( #customize-operation-tags-eg-for-ui-grouping )
235
+ - [ Change Operation Sort Order (e.g. for UI Sorting)] ( #change-operation-sort-order-eg-for-ui-sorting )
236
+ - [ Customize Schema Id's] ( #customize-schema-ids )
237
+ - [ Override Schema for Specific Types] ( #override-schema-for-specific-types )
238
+ - [ Extend Generator with Operation, Schema \& Document Filters] ( #extend-generator-with-operation-schema--document-filters )
239
+ - [ Operation Filters] ( #operation-filters )
240
+ - [ Schema Filters] ( #schema-filters )
241
+ - [ Document Filters] ( #document-filters )
242
+ - [ Add Security Definitions and Requirements] ( #add-security-definitions-and-requirements )
243
+ - [ Add Security Definitions and Requirements for Bearer auth] ( #add-security-definitions-and-requirements-for-bearer-auth )
244
+ - [ Inheritance and Polymorphism] ( #inheritance-and-polymorphism )
245
+ - [ Enabling Inheritance] ( #enabling-inheritance )
246
+ - [ Enabling Polymorphism] ( #enabling-polymorphism )
247
+ - [ Detecting Subtypes] ( #detecting-subtypes )
248
+ - [ Describing Discriminators] ( #describing-discriminators )
249
+ - [ Swashbuckle.AspNetCore.SwaggerUI] ( #swashbuckleaspnetcoreswaggerui )
250
+ - [ Change Relative Path to the UI] ( #change-relative-path-to-the-ui )
251
+ - [ Change Document Title] ( #change-document-title )
252
+ - [ Change CSS or JS Paths] ( #change-css-or-js-paths )
253
+ - [ List Multiple Swagger Documents] ( #list-multiple-swagger-documents )
254
+ - [ Apply swagger-ui Parameters] ( #apply-swagger-ui-parameters )
255
+ - [ Inject Custom JavaScript] ( #inject-custom-javascript )
256
+ - [ Inject Custom CSS] ( #inject-custom-css )
257
+ - [ Customize index.html] ( #customize-indexhtml )
258
+ - [ Enable OAuth2.0 Flows] ( #enable-oauth20-flows )
259
+ - [ Use client-side request and response interceptors] ( #use-client-side-request-and-response-interceptors )
260
+ - [ Swashbuckle.AspNetCore.Annotations] ( #swashbuckleaspnetcoreannotations )
261
+ - [ Install and Enable Annotations] ( #install-and-enable-annotations )
262
+ - [ Enrich Operation Metadata] ( #enrich-operation-metadata )
263
+ - [ Enrich Response Metadata] ( #enrich-response-metadata )
264
+ - [ Enrich Parameter Metadata] ( #enrich-parameter-metadata )
265
+ - [ Enrich RequestBody Metadata] ( #enrich-requestbody-metadata )
266
+ - [ Enrich Schema Metadata] ( #enrich-schema-metadata )
267
+ - [ Apply Schema Filters to Specific Types] ( #apply-schema-filters-to-specific-types )
268
+ - [ Add Tag Metadata] ( #add-tag-metadata )
269
+ - [ List Known Subtypes for Inheritance and Polymorphism] ( #list-known-subtypes-for-inheritance-and-polymorphism )
270
+ - [ Enrich Polymorphic Base Classes with Discriminator Metadata] ( #enrich-polymorphic-base-classes-with-discriminator-metadata )
271
+ - [ Swashbuckle.AspNetCore.Cli] ( #swashbuckleaspnetcorecli )
272
+ - [ Retrieve Swagger Directly from a Startup Assembly] ( #retrieve-swagger-directly-from-a-startup-assembly )
273
+ - [ Using the tool with the .NET SDK] ( #using-the-tool-with-the-net-sdk )
274
+ - [ Using the tool with the .NET 6.0 SDK or later] ( #using-the-tool-with-the-net-60-sdk-or-later )
275
+ - [ Use the CLI Tool with a Custom Host Configuration] ( #use-the-cli-tool-with-a-custom-host-configuration )
276
+ - [ Swashbuckle.AspNetCore.ReDoc] ( #swashbuckleaspnetcoreredoc )
277
+ - [ Apply Redoc Parameters] ( #apply-redoc-parameters )
261
278
262
279
## Swashbuckle.AspNetCore.Swagger ##
263
280
@@ -895,6 +912,7 @@ public class AutoRestSchemaFilter : ISchemaFilter
895
912
var type = context .Type ;
896
913
if (type .IsEnum )
897
914
{
915
+ schema .Extensions ??= [];
898
916
schema .Extensions .Add (
899
917
" x-ms-enum" ,
900
918
new OpenApiObject
0 commit comments