Skip to content

Commit 8e27da5

Browse files
committed
Simplify OpenApiHelpers Schema initialization
Refactor the `Schema` property in the `OpenApiHelpers` class to remove the nested `Reference` property initialization. The `Schema` property for `MediaTypeNames.Application.ProblemJson` is now directly initialized with an `OpenApiSchemaReference` using `nameof(ProblemDetails)`, reducing complexity and improving readability.
1 parent 9936db7 commit 8e27da5

2 files changed

Lines changed: 0 additions & 14 deletions

File tree

src/SimpleAuthentication.Swashbuckle/Swagger/OpenApiHelpers.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,6 @@ public static OpenApiResponse CreateResponse(string description)
2121
[MediaTypeNames.Application.ProblemJson] = new()
2222
{
2323
Schema = new OpenApiSchemaReference(nameof(ProblemDetails))
24-
{
25-
Reference = new()
26-
{
27-
Type = ReferenceType.Schema,
28-
Id = nameof(ProblemDetails)
29-
}
30-
}
3124
}
3225
}
3326
};

src/SimpleAuthentication/OpenApi/OpenApiHelpers.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,6 @@ public static OpenApiResponse CreateResponse(string description)
7070
[MediaTypeNames.Application.ProblemJson] = new()
7171
{
7272
Schema = new OpenApiSchemaReference(nameof(ProblemDetails))
73-
{
74-
Reference = new()
75-
{
76-
Type = ReferenceType.Schema,
77-
Id = nameof(ProblemDetails)
78-
}
79-
}
8073
}
8174
}
8275
};

0 commit comments

Comments
 (0)