Skip to content

Commit

Permalink
Merge pull request #685 from bcgov/dev/ionwyn/TH-1097
Browse files Browse the repository at this point in the history
Ensure schema ID is polymorphism-aware
  • Loading branch information
bcgov-brwang authored Aug 12, 2024
2 parents c2ee0d4 + 22c35a3 commit e44c86a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/Hmcr.Api/Extensions/IServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ public static void AddHmcrSwagger(this IServiceCollection services, IWebHostEnvi
var filePath = Path.Combine(System.AppContext.BaseDirectory, "Hmcr.Api.xml");
options.IncludeXmlComments(filePath);

// Ensure swagger is aware of namespace and class hierarchy, replacing occurrences of such cases with . for readability.
options.CustomSchemaIds(type => type.FullName.Replace('+', '.'));

var securitySchema = new OpenApiSecurityScheme
{
Description = "JWT Authorization header using the Bearer scheme. Example: \"Authorization: Bearer {token}\"",
Expand Down

0 comments on commit e44c86a

Please sign in to comment.