dotnet / dotnet/aspnetcore

dotnet-getdocument support OpenAPI YAML format generation

Open
#61,041 1 comment 10 reactions 0 assignees View on GitHub
area-commandlinetools feature-openapi
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 6h
Merged PRs (30d)
290

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Is your feature request related to a problem? Please describe the problem.

[dotnet-getdocument](https://github.com/dotnet/aspnetcore/blob/main/src/Tools/dotnet-getdocument/README.md) is the tool that is used by [Microsoft.Extensions.ApiDescription.Server](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/openapi/aspnetcore-openapi?view=aspnetcore-9.0&tabs=visual-studio%2Cvisual-studio-code#generate-openapi-documents-at-build-time) with Microsoft.AspNetCore.OpenApi to generate documentation at build time.

Currently, the tool can generate only JSON OpenAPI spec.
It would be nice to see `YAML` output as well, which has been commonly used with the `Swagger` generator.

### Describe the solution you'd like

Support a flag to specify output format, for example
```
--format yaml
```
or similar to `dotnet swagger`
```
--yaml
```

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.