Questions tagged [nswagstudio]
57 questions
0
votes
0 answers
How to Get NSwagStudio to Generate C# Contract with ReadOnly Attribute?
I'm running NSwagStudio v13.15.10.0 to create C# client/contract files.
I want the ReadOnly model attribute to be including in the generated C# Contract. Is this possible?
Given a sample Person model containing:
///
/// Person…

Bob Duffett
- 63
- 1
- 5
0
votes
1 answer
How to get default parameters in C# client generated through NSwag Studio?
I have this controller endpoint in .NET Core 6. I am using Swagger and NSwag Studio (latest version v13.17.0.0) to generate C# client :
[HttpGet("GetAllMinimalCalculationDtoOfMaterialByLoggedinUser/{isExistingBuildingCalculation:bool?}", Name =…
0
votes
1 answer
NSwagStudio Generated C# Client Offsets Dates
I am using NSwagStudio to generate a C# client and in general it's working great. However, I just discovered that it's not recognizing the timezone properly in date strings. I am getting an auth token back from the API with an expiration. That…

sfaust
- 2,089
- 28
- 54
0
votes
1 answer
NSwagStudio deserializing error when return type is string
I am experiencing the following error: NSwagStudio generates a typescript client which is trying to deserializing json when api return type is plain string.
I am using .netCore 2.2 and NSwagStudio 13.16.1
The client generated is:
if (status ===…

Massimo Lavermicocca
- 135
- 1
- 5
- 11
0
votes
1 answer
nSwag Client: Is there a better/easier approach to affect PropertyNameCaseInsensitive?
We are attempting to integrate System.Text.Json into our REST API and rest clients, previously using Newtonsoft.
We are using nswag CSharpClientGenerator.GenerateFile to generate our REST API clients via code (not nSwag Studio).
Because of the…

Tim Bassett
- 1,325
- 1
- 12
- 23
0
votes
1 answer
How to reuse classes when generating an OpenAPI client?
Let's say I have this class defined:
public class Animal
{
public int RegId {get;set;}
public string Name {get;set;}
}
And I need to expose it to an remote part of my system ( a client app in another location, for example ) and I decided to…

Fabricio Araujo
- 3,810
- 3
- 28
- 43
0
votes
1 answer
NSwagStudio - generated C# client post not working
I generate a C# client from a .NET 4.8 Web API with NSwagStudio and everything works fine (all get requests) except for the posts. This is due to a wrong JSON serializer setting when converting an object to string.
If I construct the body like…

joachim_b
- 173
- 11
0
votes
0 answers
NSwagStudio how to generate enum properties as string
I'd like to generate enum properties as string but when I use the NSwagStudio or Unchase OpenApi extension for VS2019 for generating C# client code, there is no specific property to do this.
In the properties file ConnectedServices.json there are…

Marco Di Scala
- 424
- 1
- 7
- 18
0
votes
2 answers
Getting the result of Iactionresult in .net Core using nswagger studio
I have this api as you can see :
[HttpGet("CreateToken")]
public IActionResult CreateToken()
{
string tokenString = string.Empty;
tokenString = BuildJWTToken();
return Ok(new { Token = tokenString });
}
I…

Ehsan Akbar
- 6,977
- 19
- 96
- 180
0
votes
1 answer
NSwag: a clear steps and clean sample on how to use class extensions in NSwag studio
There are not clear documentation on how to extend the auto-generated TS file using NSwag. I mean the extension methods with a protector access modifier
here a discussion with the NSwag's owner:
https://github.com/RicoSuter/NSwag/issues/1012
but…

AbuDawood
- 745
- 7
- 22
0
votes
0 answers
Ionic Angular HttpClient injection not working
I have auto-generated a WebAPI service module with NSwagStudio to connect my Ionic/Angular app and my webservice together. This service (WebApiConnector.Client) is configured to be injected:
imports: [
BrowserModule,
IonicModule.forRoot(),
…

MFeltrin
- 3
- 5
-1
votes
1 answer
Swagger The type 'addressFamily' already contains a definition for '_6'
Every time I use NSwagStudio to generate a new NSwagProxy.cs file I have the above error. I have a duplicate of _6 and _7. My development team always has to scroll through the file to delete these two extra lines. The duplicates are also in the…

Kile
- 1
- 2