nswag Questions
3
We have a Swagger.json output by using AddOpenApiDocument (see below).
A snippet from the swagger as below shows it returns a 200 response type of application/json. The schema part (which I am not ...
Resistant asked 25/4, 2021 at 14:48
4
Solved
I am in need of adding custom headers, but cannot figure it out. I am trying to utilize the new services.AddOpenApiDocument() instead of the services.AddSwaggerDocument(). I want to add these custo...
Dunstan asked 22/4, 2019 at 16:19
3
I have a .Net Core v2.1 Web API which uses NSwag to generate its Swagger Json.
I have a response model as such -
public class LoginResponse
{
public LoginResult LoginResult { get; set; }
}
publ...
Frightened asked 4/10, 2018 at 14:18
2
I have a polymorphic model:
public class CreateOrderRequest
{
public List<CreateOrderItem> OrderItems { get; set; }
}
/// <summary>
/// Identifies a new item within an order
/// <...
Rapt asked 4/9, 2017 at 22:42
2
Context
I've added a connected service to my .NET 6 project and using NSwagCSharp code generator to generate the client. (In my previous project I used NSwagStudio)
I discovered that in the .csproj...
Scumble asked 20/11, 2021 at 7:55
4
Solved
this autogenerated service (by NSwagStudio) needs an API_BASE_URL (InjectionToken) value in order to perform http requests
how and where i can inject it?
/* tslint:disable */
//-------------------...
2
ASP.NEt Core 3.1
I would like to suppress one certain controller. Therefore i tried use the DocumentProcessor, but without success.
public class DocumentProcessor : IDocumentProcessor
I have no ...
Cache asked 7/5, 2020 at 8:6
4
Solved
I didn't get exactly how NSwag interact with IdentityServerX bearer tokens and adds it request header conventionally? My host api application implements IdentityServer3 with LDAP auth, so as far as...
Ingredient asked 13/10, 2016 at 15:57
1
We currently have over 100 DTOs already well-designed in a separate assembly and span multiple namespaces. How can we instruct the NSwag C# client generator to utilize our existing DTO library inst...
6
Solved
It's possible to generate client code so that model's class names have full namespaces as prefix?
That should avoid same class name conflicts.
Example
com.foo.MyClass
and
it.foo.MyClass
...
Donne asked 21/7, 2017 at 15:15
3
Solved
I'm using ASP.NET Core and NSwag to host and describe a new web service hosted in IIS with Windows Authentication.
Locally I run the web service using https, but when I deploy to a test environmen...
Trumpery asked 3/10, 2018 at 16:48
2
In an Asp.Net Core v3.1 api, Swagger v3.0, the Swagger UI cannot load API definitions when I have declared multiple versions.
Edit: Also from NuGet:
Mcrosoft.AspNetCore.Mvc.Versioning v4.1.1
NSwag....
Tunicle asked 30/9, 2020 at 20:37
3
Solved
I am using Nswag to generate client library to consume an API created from .NET Core Application.
Currently I am using actions that returns IActionResult to benefit from methods such as return NotF...
Wedekind asked 19/12, 2019 at 10:31
2
So i'm using swagger and Nswag for a very long time, I can see the auto generated methods used to generate a line like this to exit as default value:
return _observableOf<MyClassData>(<any...
1
Solved
I have an Enum declared on a API like this :
public enum Currencies
{
RON = 1,
USD,
EUR,
GBP,
CHF,
PLN,
CAD,
HUF,
NOK,
SEK
}
but when I use NSwag to generate a HttpClient, it starts f...
Cabdriver asked 26/1, 2022 at 18:5
3
I'm using NSwag to generate my TypeScript client (Angular format), but I'm having problems with implementing Bearer token authentication because of circular dependencies.
My user service needs to ...
4
Solved
I'm using NSwag for .NET Core 3.1. Everything works correctly.
I can't determine how to change "My Title" (which is the info title) to something else.
Here is the swagger page:
Here is my reg...
Jolly asked 7/4, 2020 at 1:30
2
Solved
What is the preferred way to make a VS connected service (NSwag) injected into classes/controllers. I have found a lot of suggestions on the net to use this form:
services.AddHttpClient<IClient,...
Palma asked 26/9, 2021 at 8:50
3
I have a .NET 5.0 ASP.NET Core project and I am using Nswag to generate an API client.
Let's say I have the following API model:
public class GetFooListResponseModel
{
public string Bar { get; set...
Wold asked 14/12, 2020 at 9:52
0
I reference an OpenAPI service using the "Connected Services" feature in Visual Studio (2002 Prev 5, but same behavior in VS 2019). This tool is based on NSwag. The docs say that I can ap...
1
Solved
I do have my .net data classes, containing a few decimal fields (for example quantity). I generate an openapi.json out of it running dotnet swagger.
...
"quantity": {
"type": &...
Rusticate asked 11/10, 2021 at 9:8
1
I am using NSwag to generate C# rest client for my asp.net core web API. At the moment, I just need to generate the client interfaces and not the classes themselves. I tried the following settings ...
Lipinski asked 19/9, 2020 at 20:23
1
I've read in the documentation that "The two main OpenAPI implementations for .NET are Swashbuckle and NSwag" but what are the differences between them?
Sherris asked 20/7, 2021 at 9:1
1
we're currently using Swashbuckle.AspNetCore for API documentation purpose, but when it comes to generation of client-side models (Typescript) it seems there is a major drawback of it.
As a sample,...
Shortfall asked 10/3, 2021 at 13:19
2
Solved
I am trying to generate the client code in both .NET Core and TypeScript using NSwag CLI:
nswag run options.nswag
This works correctly for various Swagger 2.0 JSON files, but generates multiple ...
1 Next >
© 2022 - 2024 — McMap. All rights reserved.