Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 join this conversation on GitHub. Already have an account? Sign in to comment
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