https://github.com/dmitry-pavlov/openapi-connected-service
Visual Studio extension to generate OpenAPI (Swagger) web service reference.
https://github.com/dmitry-pavlov/openapi-connected-service
nswag openapi openapi-codegen visual-studio visual-studio-extension vsix vsix-extensions
Last synced: 10 months ago
JSON representation
Visual Studio extension to generate OpenAPI (Swagger) web service reference.
- Host: GitHub
- URL: https://github.com/dmitry-pavlov/openapi-connected-service
- Owner: dmitry-pavlov
- Created: 2019-01-03T17:04:08.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T04:44:44.000Z (about 3 years ago)
- Last Synced: 2023-06-04T23:00:39.460Z (over 2 years ago)
- Topics: nswag, openapi, openapi-codegen, visual-studio, visual-studio-extension, vsix, vsix-extensions
- Language: C#
- Homepage: https://marketplace.visualstudio.com/items?itemName=dmitry-pavlov.OpenAPIConnectedService
- Size: 2.14 MB
- Stars: 67
- Watchers: 5
- Forks: 16
- Open Issues: 9
-
Metadata Files:
- Readme: README.MD
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
[OpenAPI (Swagger) Connected Service](https://marketplace.visualstudio.com/items?itemName=dmitry-pavlov.OpenAPIConnectedService) is a Visual Studio extension to generate `C#` `HttpClient` code for `OpenAPI` (formerly [`Swagger API`](https://swagger.io/docs/specification/about/)) web service with [NSwag](https://github.com/RSuter/NSwag)
Simply put, it is like `Add Service Reference` for `WCF` or `Add Web Reference` for `WSDL`, but for `JSON` `API`.
# Getting Started
Install from `Tools -> Extensions and Updates` menu inside Visual Studio or [download](https://marketplace.visualstudio.com/items?itemName=dmitry-pavlov.OpenAPIConnectedService) as `VSIX` package from Visual Studio Marketplace

# HowTos
- [ ] How to open *.nswag files with NSwagStudio from Solution Explorer
- [x] [How to add generated HttpClient to ASP.NET Core dependency injection (DI)](docs/How-to-Add-Generated-HttpClient-to-ASPNETCore-Dependency-Injection.MD)
# Troubleshooting
## Generated code compilation errors
If your project target framework is `net461` you might need to add the following packages via [`NuGet Package Manager`](https://docs.microsoft.com/en-us/nuget/tools/package-manager-ui):
- [`Newtonsoft.Json`](https://www.nuget.org/packages/Newtonsoft.Json/)
- [`System.Net.Http`](https://www.nuget.org/packages/System.Net.Http/)
- [`System.Runtime.Serialization.Json`](https://www.nuget.org/packages/System.Runtime.Serialization.Json/)
## Can't open .nswag file in NSwagStudio
- If generated code corrupted, try to open `.nswag` file in [`NSwagStudio`](https://github.com/RSuter/NSwag/wiki/NSwagStudio) (Windows GUI for editing .*nswag files).
- If it doesn't open, try to create new `.nswag` file in [`NSwagStudio`](https://github.com/RSuter/NSwag/wiki/NSwagStudio) for the same API service link and check the differences.
- If you found bug, please report it [here](https://github.com/dmitry-pavlov/openapi-connected-service/issues/new?title=BUG). Thank you in advance!
# Roadmap
See the [changelog](docs/CHANGELOG.MD) for the further development plans and version history.
# Feedback
Please feel free to [request a feature](https://github.com/dmitry-pavlov/openapi-connected-service/issues/new?title=FEATURE) or [report a bug](https://github.com/dmitry-pavlov/openapi-connected-service/issues/new?title=BUG).
# Support Development
Just consider [buying me a coffee](https://www.buymeacoffee.com/dmitrypavlov). Thank you for your support!