Questions tagged [nswag]

NSwag is a Swagger 2.0 API toolchain for .NET, TypeScript and other platforms, written in C#. The Swagger specification uses JSON and JSON Schema to describe a RESTful web API. The project provides tools to generate Swagger specifications from existing Web API controllers and client code from these Swagger specifications.

The project combines the functionality of Swashbuckle (Swagger generation) and AutoRest (client generation) in one tool chain. This way a lot of incompatibilites can be avoided and features which are not well described by the Swagger specification or JSON Schema are better supported (e.g. inheritance, enum and reference handling). The NSwag project heavily uses NJsonSchema for .NET for JSON Schema handling and C#/TypeScript class/interface generation.

http://NSwag.org

414 questions
0
votes
1 answer

NSwag Angular 5 how to get the json response?

I'm accessing an api and I generated using NSwagStudio a type script version of the api calls to use as services. I get the response from the server and seems to work fine, but I don't know how to access the json file with the response. I tried…
Probandot
  • 195
  • 1
  • 16
0
votes
1 answer

NSwag.MSBuild TypeScript version issues

In NSwag Studio there's a flag to use a specific TypeScript version for the generated TypeScript typings/code. Inside my .csproj file I'm trying to accomplish the same things but it doesn't seem to have any effect. Here's my MSBuild command:
lucassp
  • 4,133
  • 3
  • 27
  • 36
0
votes
1 answer

Add providers post-declaration of AppModule

Angular 2+ registers providers in the following way: // @NgModule decorator with its metadata @NgModule({ declarations: [...], imports: [...], providers: [], bootstrap: [...] }) export class AppModule { } I want to…
MgSam
  • 12,139
  • 19
  • 64
  • 95
0
votes
0 answers

Post FromBody not working without trailing slash

I have an ASP.Net Core 2.0 Web API project that utilizes NSwag to get Swagger functionality. The problem is that when I use the SwaggerUI to test the API, the FromBody parameter is not working. However when I use Postman with the same body and…
user4344677
0
votes
1 answer

How to force NSwag to include custom response codes from xml comments at the auto-generated swagger json of a web API call

This is the definition added in clean1.csproj file based on NSwag's documentation
Giannis Grivas
  • 3,374
  • 1
  • 18
  • 38
0
votes
1 answer

Merging common output from multiple JSON schema files

I have a number of JSON schema files and have used NSwagStudio to generate the C# client classes Each output on it's own works fine, but unfortunately there are some common elements in each json file Is there anyway to automatically merge the…
SteveC
  • 15,808
  • 23
  • 102
  • 173
-1
votes
1 answer

Swagger "The method 'get' on path '../api/' is registered multiple times" error

I use OpenAPI / Swagger in an Angular app based on .NET Core and I encounter "The method 'get' on path '../api/' is registered multiple times" error when generating frontend code as TypeScript using NSwag Studio. As far as I see on Github pages,…
Jack
  • 1
  • 21
  • 118
  • 236
-1
votes
1 answer

Swagger UI display generated client

There is swagger and there is nswag. NSwag does some client generation. Is it possible to generate client and display it as a link on Swagger UI for the consumers to download and use it?
DarthVader
  • 52,984
  • 76
  • 209
  • 300
-1
votes
1 answer

How is the json schema is looks like to generate a swager client with nswag

Here is a tab on nswag: So how it the schema should be looks like? Routes, definitions, etc?
Sergino
  • 10,128
  • 30
  • 98
  • 159
1 2 3
27
28