File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
src/Swashbuckle.AspNetCore.SwaggerGen/SchemaGenerator Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -278,6 +278,7 @@ private OpenApiSchema CreatePrimitiveSchema(DataContract dataContract)
278
278
{
279
279
schema . Enum = dataContract . EnumValues
280
280
. Select ( value => JsonSerializer . Serialize ( value ) )
281
+ . Distinct ( )
281
282
. Select ( valueAsJson => OpenApiAnyFactory . CreateFromJson ( valueAsJson ) )
282
283
. ToList ( ) ;
283
284
@@ -288,8 +289,8 @@ private OpenApiSchema CreatePrimitiveSchema(DataContract dataContract)
288
289
{
289
290
schema . Enum = dataContract . UnderlyingType . GetEnumValues ( )
290
291
. Cast < object > ( )
291
- . Distinct ( )
292
292
. Select ( value => dataContract . JsonConverter ( value ) )
293
+ . Distinct ( )
293
294
. Select ( valueAsJson => OpenApiAnyFactory . CreateFromJson ( valueAsJson ) )
294
295
. ToList ( ) ;
295
296
}
You can’t perform that action at this time.
0 commit comments