{"id":13594467,"url":"https://github.com/unchase/Unchase.OpenAPI.Connectedservice","last_synced_at":"2025-04-09T07:32:31.544Z","repository":{"id":45470245,"uuid":"178596119","full_name":"unchase/Unchase.OpenAPI.Connectedservice","owner":"unchase","description":":scroll: Visual Studio extension to generate OpenAPI (Swagger) web service reference.","archived":false,"fork":false,"pushed_at":"2023-06-20T19:36:54.000Z","size":9220,"stargazers_count":106,"open_issues_count":6,"forks_count":17,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-02T16:52:21.445Z","etag":null,"topics":["nswag","nswagstudio","odata","openapi","openapi-client","openapi-codegen","openapi3","scaffolding","swagger","visual-studio","visual-studio-extension","vsix","vsix-extensions"],"latest_commit_sha":null,"homepage":"https://marketplace.visualstudio.com/items?itemName=unchase.unchaseOpenAPIConnectedService","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/unchase.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"github":["unchase"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":"https://www.buymeacoffee.com/nikolaychebotov"}},"created_at":"2019-03-30T18:26:16.000Z","updated_at":"2024-07-23T08:51:09.000Z","dependencies_parsed_at":"2024-01-02T22:40:12.145Z","dependency_job_id":"19c36d7e-0a1e-4c5a-a571-e59b4bf9705a","html_url":"https://github.com/unchase/Unchase.OpenAPI.Connectedservice","commit_stats":null,"previous_names":[],"tags_count":110,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unchase%2FUnchase.OpenAPI.Connectedservice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unchase%2FUnchase.OpenAPI.Connectedservice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unchase%2FUnchase.OpenAPI.Connectedservice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unchase%2FUnchase.OpenAPI.Connectedservice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unchase","download_url":"https://codeload.github.com/unchase/Unchase.OpenAPI.Connectedservice/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223375348,"owners_count":17135354,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nswag","nswagstudio","odata","openapi","openapi-client","openapi-codegen","openapi3","scaffolding","swagger","visual-studio","visual-studio-extension","vsix","vsix-extensions"],"created_at":"2024-08-01T16:01:33.941Z","updated_at":"2024-11-06T16:31:24.697Z","avatar_url":"https://github.com/unchase.png","language":"C#","readme":"![Logo](img/Unchase-OpenAPI-Swagger-Connected-Service-Logo.png)\n\n[Unchase OpenAPI (Swagger) Connected Service](https://marketplace.visualstudio.com/items?itemName=Unchase.unchaseOpenAPIConnectedService) is a Visual Studio 2017/2019/2022 extension to generate `C#` (`TypeScript`) `HttpClient` (or `C#` `Controllers`) code for `OpenAPI` (formerly [`Swagger API`](https://swagger.io/docs/specification/about/)) web service with [NSwag](https://github.com/RSuter/NSwag).\n\n\u003e Starting from Visual Studio Community 2019 v16.1.3 extensions based on `Microsoft Connected Services` now work fine.\n\n\u003e The project is developed and maintained by [Nikolay Chebotov (**Unchase**)](https://github.com/unchase).\n\n## Getting Started\n\n#### **[Read How-To on medium.com](https://medium.com/@unchase/how-to-generate-c-or-typescript-client-code-for-openapi-swagger-specification-d882d59e3b77)**\n\nInstall from `Tools -\u003e Extensions and Updates` menu inside [Visual Studio](https://visualstudio.microsoft.com/vs/) 2017 (for [VisualStudio](https://visualstudio.microsoft.com/vs/) 2019: `Extensions -\u003e Manage Extensions`) or [download](http://vsixgallery.com/extensions/Unchase.OpenAPI.ConnectedService.63199638-6211-4285-ba8f-75b1f0326c2a/extension.vsix)  as `VSIX` package from VSGallery or [download](https://marketplace.visualstudio.com/items?itemName=unchase.unchaseOpenAPIConnectedService)  as `VSIX` package from [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=Unchase.unchaseopenapiconnectedservice):\n\n![Adding Unchase OpenAPI (Swagger) Connected Service in Visual Studio](img/Unchase-OpenAPI-Swagger-Connected-Service.gif)\n\n## Builds status\n\n|Status|Value|\n|:----|:---:|\n|Build|[![Build status](https://ci.appveyor.com/api/projects/status/90oewanfh32fjcr6)](https://ci.appveyor.com/project/unchase/unchase.openapi.connectedservice)\n|Buid History|![Build history](https://buildstats.info/appveyor/chart/unchase/unchase-openapi-connectedservice)\n|GitHub Release|[![GitHub release](https://img.shields.io/github/release/unchase/Unchase.OpenAPI.Connectedservice.svg)](https://github.com/unchase/Unchase.OpenAPI.Connectedservice/releases/latest)\n|GitHub Release Date|[![GitHub Release Date](https://img.shields.io/github/release-date/unchase/Unchase.OpenAPI.Connectedservice.svg)](https://github.com/unchase/Unchase.OpenAPI.Connectedservice/releases/latest)\n|GitHub Release Downloads|[![Github Releases](https://img.shields.io/github/downloads/unchase/Unchase.OpenAPI.Connectedservice/total.svg)](https://github.com/unchase/Unchase.OpenAPI.Connectedservice/releases/latest)\n|VS Marketplace|[![VS Marketplace](http://vsmarketplacebadge.apphb.com/version-short/unchase.UnchaseOpenAPIConnectedService.svg)](https://marketplace.visualstudio.com/items?itemName=unchase.unchaseOpenAPIConnectedService)\n|VS Marketplace Downloads|[![VS Marketplace Downloads](http://vsmarketplacebadge.apphb.com/downloads-short/unchase.UnchaseOpenAPIConnectedService.svg)](https://marketplace.visualstudio.com/items?itemName=unchase.unchaseOpenAPIConnectedService)\n|VS Marketplace Installs|[![VS Marketplace Installs](http://vsmarketplacebadge.apphb.com/installs-short/unchase.UnchaseOpenAPIConnectedService.svg)](https://marketplace.visualstudio.com/items?itemName=unchase.unchaseOpenAPIConnectedService)\n\n## Features\n\n- Generate `C#` or `TypeScript` clients/proxies (client code) from Swagger 2.0 and OpenAPI 3.0 specifications\n- Generate `C#` ASP.NET Controller from Swagger 2.0 and OpenAPI 3.0 specifications\n- **Experimental**: Generate `C#` or `TypeScript` clients/proxies (client code) or ASP.NET Controller from OData specification converted to OpenAPI based on [OpenAPI.NET.OData](https://github.com/microsoft/OpenAPI.NET.OData)\n- Generate `.nswag` file for using in [`NSwagStudio`](https://github.com/NSwag/NSwag/wiki/NSwagStudio) (no need to install for generating)\n- Add required dependencies for the `C#` client (before generating):\n\t- Library targeting .NET Standard 1.4+:\n\t\t1. Newtonsoft.Json ([NuGet](https://www.nuget.org/packages/Newtonsoft.Json))\n\t\t2. System.Net.Http ([NuGet](https://www.nuget.org/packages/System.Net.Http))\n\t\t3. System.ComponentModel.Annotations ([NuGet](https://www.nuget.org/packages/System.ComponentModel.Annotations))\n\t- Library targeting the full .NET:\n\t\t1. Newtonsoft.Json ([NuGet](https://www.nuget.org/packages/Newtonsoft.Json))\n\t\t2. System.Runtime.Serialization (GAC)\n\t\t3. System.ComponentModel.DataAnnotations (GAC)\n\t- Library targeting PCL 259 (Portable Class Library):\n\t\t1. Newtonsoft.Json ([NuGet](https://www.nuget.org/packages/Newtonsoft.Json))\n\t\t2. Microsoft.Net.Http ([NuGet](https://www.nuget.org/packages/Microsoft.Net.Http))\n\t\t3. Portable.DataAnnotations ([NuGet](https://www.nuget.org/packages/Portable.DataAnnotations))\n- Add Required dependences for the `C#` controller (before generating):\n\t1. Microsoft.AspNetCore.Mvc ([NuGet](https://www.nuget.org/packages/Microsoft.AspNetCore.MVC))\n- **Command** to open generated `.nswag` and `.nswag.json` files in [NSWagStudio](https://github.com/NSwag/NSwag/wiki/NSwagStudio)\n- **Command** to compare `.nswag.json` specification file with another `.nswag.json` specification file (or specification given by `endpoint`)\n- Storage of the last 10 endpoints (specification path)\n\n## Settings Meaning\n\nMeaning of the Unchase [OpenAPI (Swagger) Connected Service](https://marketplace.visualstudio.com/items?itemName=unchase.unchaseOpenAPIConnectedService) settings according to [NSwagStudio](https://github.com/NSwag/NSwag/wiki/NSwagStudio):\n\n![Unchase OpenAPI (Swagger) Connected Service settings meaning](img/Unchase-OpenAPI-Swagger-Connected-Service-Settings-Meaning.png)\n\n## Exclude type names\n\nSince [v1.4.0](https://github.com/unchase/Unchase.OpenAPI.Connectedservice/releases/tag/v1.4.0) you can exclude type names in separate Window for C# client code generation:\n\n![Unchase OpenAPI (Swagger) Connected Service - exclude type names](img/Csharp-Client-Generation-Exclude-Type-Names.png)\n\n## Generate code from OData specification converted to OpenAPI specification\n\nSince [v1.5.0](https://github.com/unchase/Unchase.OpenAPI.Connectedservice/releases/tag/v1.4.0) you can generate code from OData specification converted to OpenAPI specification:\n\n![Unchase OpenAPI (Swagger) Connected Service - generate from OData](img/Csharp-Client-Generation-OData.png)\n\n## Custom Commands\n\n### `Open in NSwagStudio` Command\n\nSince *v1.1.** have been added menu command embedded in Visual Studio Solution Explorer context menu lets you open generated `.nswag` and `.nswag.json` files in [NSwagStudio](https://github.com/NSwag/NSwag/wiki/NSwagStudio).\n\nThis extension is for those times where you generate `.nswag` and `.nswag.json` files and you want to be able to quickly open it in [NSwagStudio](https://github.com/NSwag/NSwag/wiki/NSwagStudio).\n\n#### Prerequisite\n\n\u003e In order to use this extension, you must have [Visual Studio](https://visualstudio.microsoft.com/vs/) 2017/2019, this connected service as well as [NSwagStudio](https://github.com/NSwag/NSwag/wiki/NSwagStudio) installed.\n\n#### Solution Explorer\n\nYou can open `.nswag` and `.nswag.json` files in [NSWagStudio](https://github.com/NSwag/NSwag/wiki/NSwagStudio) by simply right-clicking it in Solution Explorer and select **Open in NSwagStudio**:\n\n![Open in NSwagStudio menu Command](img/OpenWithNSwagCommandMenu.png)\n\n#### Path to NSwagStudio.exe\n\nIf you installed [NSwagStudio](https://github.com/NSwag/NSwag/wiki/NSwagStudio) at a non-default location, a prompt will ask for the path to `NSwagStudio.exe`.\n\nYou can always change the location in *Tools -\u003e Options -\u003e Web -\u003e Unchase OpenAPI (Swagger) Connected Service*:\n\n![Open in NSwagStudio Option](img/UnchaseOpenAPIConnectedServiceCommandsOptions1.png)\n\n### `Compare OpenAPI-specifications...` Command\n\nSince *v1.2.** have been added menu command embedded in Visual Studio Solution Explorer context menu lets you compare generated `.nswag.json` specification-file with another `.nswag.json` specification-file (or with specification given by `endpoint`).\n\nThis extension is for those times where you generate `.nswag.json` file and you want to quickly compare it with another specification or specification given by `endpoint`.\n\n#### Prerequisite\n\n\u003e In order to use this extension, you must have [Visual Studio](https://visualstudio.microsoft.com/vs/) 2017/2019 as well as this connected service.\n\n#### Solution Explorer\n\nYou can compare `.nswag.json` specification-file with another `.nswag.json` specification-file (or with specification given by `endpoint`) by simply selecting one or two files and right-clicking them in Solution Explorer and select **Compare OpenAPI-specifications...**:\n\n![Compare OpenAPI Specifications Command](img/CompareOpenAPISpecificationsOneFileCommandMenu.png) ![Compare OpenAPI Specifications Command](img/CompareOpenAPISpecificationsTwoFilesCommandMenu.png)\n\n#### Path to the specification `Endpoint`\n\nYou can always change the specification Endpoint to compare with in *Tools -\u003e Options -\u003e Web -\u003e Unchase OpenAPI (Swagger) Connected Service*:\n\n![Compare OpenAPI Specifications Option](img/UnchaseOpenAPIConnectedServiceCommandsOptions2.png)\n\n#### Compare View\n\n![Compare OpenAPI Specifications Command result](img/CompareOpenAPISpecificationsCommandResult.png)\n\n## HowTos\n\n- [ ] Add HowTos in a future\n- [ ] ... [request for HowTo you need](https://github.com/unchase/Unchase.OpenAPI.Connectedservice/issues/new?title=DOC)\n\n## Troubleshooting\n\n### Can't open .nswag file in NSwagStudio\n\n- You can use **Open in NSwagStudio** menu command\n- If generated code corrupted, try to open `.nswag` file in [`NSwagStudio`](https://github.com/RSuter/NSwag/wiki/NSwagStudio) (Windows GUI for editing .*nswag files)\n- 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\n\n### Installation completes but I can't see the Service in the list of connected services (Visual Studio 2019)\n\n- Relevant [bug report](https://developercommunity.visualstudio.com/content/problem/468751/vs2019-preview-cannot-install-connected-service-ex.html). `Connected Services` restored in the v16.1.3 update to [Visual Studio](https://visualstudio.microsoft.com/vs/) 2019.\n\n## Roadmap\n\nSee the [changelog](CHANGELOG.md) for the further development plans and version history.\n\n## Feedback\n\nPlease feel free to add your [review](https://marketplace.visualstudio.com/items?itemName=unchase.unchaseOpenAPIConnectedService\u0026ssr=false#review-details), [request a feature](https://github.com/unchase/Unchase.OpenAPI.Connectedservice/issues/new?title=FEATURE), [ask a question](https://marketplace.visualstudio.com/items?itemName=unchase.unchaseOpenAPIConnectedService\u0026ssr=false#qna) or [report a bug](https://github.com/unchase/Unchase.OpenAPI.Connectedservice/issues/new?title=BUG) including in connected service: \n\n![Unchase OpenAPI Connected Service Report a Bug](img/Unchase-OpenAPI-Connected-Service-ReportBug.png)\n\nThank you in advance!\n\n## Thank me!\n\nIf you like what I am doing and you would like to thank me, please consider:\n\n[![Buy me a coffe!](img/buymeacoffe.png)](https://www.buymeacoffee.com/nikolaychebotov)\n\nThank you for your support!\n\n----------\n\nCopyright \u0026copy; 2019 [Nikolay Chebotov (**Unchase**)](https://github.com/unchase) - Provided under the [Apache License 2.0](LICENSE.md).\n\n","funding_links":["https://github.com/sponsors/unchase","https://www.buymeacoffee.com/nikolaychebotov"],"categories":["C#","C\\#","Visual Studio Plugins","Visual Studio 插件"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funchase%2FUnchase.OpenAPI.Connectedservice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funchase%2FUnchase.OpenAPI.Connectedservice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funchase%2FUnchase.OpenAPI.Connectedservice/lists"}