Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

Generate swagger.json locally #626

Open
bacongobbler opened this issue Apr 13, 2022 · 1 comment
Open

Generate swagger.json locally #626

bacongobbler opened this issue Apr 13, 2022 · 1 comment
Labels
API Issues or pull requests that affect the API enhancement New feature or request

Comments

@bacongobbler
Copy link
Contributor

Right now, the process to update hippo-openapi's swagger.json is the following:

  1. Run the development server
  2. Fetch the swagger.json from /swagger/v1/swagger.json
  3. Re-generate the OpenAPI clients

We could make this better by having dotnet build re-generate a swagger.json file locally.

@bacongobbler bacongobbler added this to the API enhancements milestone Apr 13, 2022
@bacongobbler bacongobbler added enhancement New feature or request API Issues or pull requests that affect the API labels Apr 13, 2022
@bacongobbler
Copy link
Contributor Author

bacongobbler commented Apr 13, 2022

reference:

hippo/src/Web/Program.cs

Lines 58 to 80 in 1bbeb50

builder.Services.AddSwaggerGen(c =>
{
c.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme
{
Name = "Authorization",
Description = "JWT Authorization header using the Bearer scheme. Example: \"Authorization: Bearer {token}\"",
Type = SecuritySchemeType.ApiKey,
In = ParameterLocation.Header,
Scheme = "Bearer",
BearerFormat = "JWT",
});
c.AddSecurityRequirement(new OpenApiSecurityRequirement
{
{
new OpenApiSecurityScheme
{
Reference = new OpenApiReference { Type = ReferenceType.SecurityScheme, Id = "Bearer" }
},
new List<string>()
}
});
});

@bacongobbler bacongobbler removed this from the API enhancements milestone May 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
API Issues or pull requests that affect the API enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant