-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Add APIs for viewing generated OpenAPI file at runtime #54600
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
Comments
Thank you for submitting this for API review. This will be reviewed by @dotnet/aspnet-api-review at the next meeting of the ASP.NET Core API Review group. Please ensure you take a look at the API review process documentation and ensure that:
|
API Review:
API Approved! // Assembly: Microsoft.AspNetCore.OpenApi
namespace Microsoft.AspNetCore.Builder;
public static class OpenApiEndpointRouteBuilderExtensions
{
public static IEndpointConventionBuilder MapOpenApi(this IEndpointRouteBuilder builder, [StringSyntax("Route")] string pattern = "openapi.json");
}
namespace Microsoft.Extensions.DependencyInjection;
public static class OpenApiServiceCollectionExtensions
{
public static IServiceCollection AddOpenApi(this IServiceCollection serviceCollection);
public static IServiceCollection AddOpenApi(this IServiceCollection serviceCollection, Action<OpenApiOptions> configureOptions);
}
namespace Microsoft.AspNetCore.OpenApi;
public class OpenApiOptions
{
public OpenApiSpecVersion OpenApiVersion { get; set; }
} |
Has anyone ever asked for the ability to split up their open API document into multiple different endpoints? Do we assume that there is only ever one OpenAPI document for the entire app? |
Yes, there's often a need to do multiple documents for different versions of an API or different visibilities (public versus internal). #54676 outlines how we intend to do this. |
Closing as this is merged to main. |
Background and Motivation
See #54598 for full background and motivation.
As part of our effort to add built-in support for OpenAPI document generation in the framework, we are adding APIs to register OpenAPI-related services and endpoints in the target user app.
Proposed API
Note: All APIs are net new.
Usage Examples
Alternative Designs
N/A
Risks
N/A
The text was updated successfully, but these errors were encountered: