3.1 KiB
3.1 KiB
Microsoft.dotnet-openapi
Microsoft.dotnet-openapi is a tool for managing OpenAPI references within your project.
Commands
Add Commands
Add File
Options
| Short option | Long option | Description | Example |
|---|---|---|---|
| -v | --verbose | Show verbose output. | dotnet openapi add file -v .\OpenAPI.json |
| -p | --updateProject | The project to operate on. | dotnet openapi add file --updateProject .\Ref.csproj .\OpenAPI.json |
Arguments
| Argument | Description | Example |
|---|---|---|
| source-file | The source to create a reference from. Must be an OpenAPI file. | dotnet openapi add file .\OpenAPI.json |
Add URL
Options
| Short option | Long option | Description | Example |
|---|---|---|---|
| -v | --verbose | Show verbose output. | dotnet openapi add url -v http://contoso.com/openapi.json |
| -p | --updateProject | The project to operate on. | dotnet openapi add url --updateProject .\Ref.csproj http://contoso.com/openapi.json |
| -o | --output-file | Where to place the local copy of the OpenAPI file. | dotnet openapi add url https://contoso.com/openapi.json --output-file myclient.json |
Arguments
| Argument | Description | Example |
|---|---|---|
| source-file | The source to create a reference from. Must be a URL. | dotnet openapi add url https://contoso.com/openapi.json |
Remove
Options
| Short option | Long option | Description | Example |
|---|---|---|---|
| -v | --verbose | Show verbose output. | dotnet openapi remove -v |
| -p | --updateProject | The project to operate on. | dotnet openapi remove --updateProject .\Ref.csproj .\OpenAPI.json |
Arguments
| Argument | Description | Example |
|---|---|---|
| source-file | The source to remove the reference to. | dotnet openapi remove .\OpenAPI.json |
Refresh
Options
| Short option | Long option | Description | Example |
|---|---|---|---|
| -v | --verbose | Show verbose output. | dotnet openapi refresh -v https://contoso.com/openapi.json |
| -p | --updateProject | The project to operate on. | dotnet openapi refresh --updateProject .\Ref.csproj https://contoso.com/openapi.json |
Arguments
| Argument | Description | Example |
|---|---|---|
| source-file | The URL to refresh the reference from. | dotnet openapi refresh https://contoso.com/openapi.json |