Questions tagged [nswagstudio]
57 questions
2
votes
0 answers
NSwag missing [Display] data annotation for C# client generated code
I'm currently using NSwag Studio to generate my C# Client. I have the setting "generate data annotation attributes" turned on and seems to work well for data annotations such as [Required], [Range] etc...
I've noticed, however, that not all…

Andrew
- 238
- 1
- 9
2
votes
1 answer
How to generate Basic authentication code with NSwagStudio?
I am using NSwagStudio to generate the client classes/code from an Swagger 2.0 JSON file.
Previously, it used to generate the following authentication code:
//Authentication
var plainTextBytes =…

Sekhar
- 5,614
- 9
- 38
- 44
1
vote
0 answers
nswag net 6 auto generated c# client
I have an .net 6 api that already uses swagger to generate the swagger UI. I am attempting to create a C# client that lives in a class library. The structure will look something like this.
Application.API - the project with the…

MakeThePainStop
- 91
- 9
1
vote
2 answers
Setting Authorization Header of HttpClient doesnt work
I use NSwagStadio to write httpClient codes.I use authorization in api. I can login and register with httpClient codes but when I want to access apiControllers that need authentication I get 401 status code.All codes work correct if I remove…

Ali M
- 11
- 1
1
vote
0 answers
NSwag Duplicate objects created
I use NSwagStudio to create a C# client from an OpenAPI document.
So far everything works, but I noticed a problem to which I haven't found a solution yet.
The problem is that NSwagStudio creates duplicate classes for a recurring structure.
The…

user3644868
- 127
- 1
- 1
- 6
1
vote
0 answers
Rename parameters on NSwag.MSBuild
I got a bit weird swagger.spec from other developer which mainly has 2 variable that uses similar name but with @ at the start. to give an example:
openapi: 3.0.3
info:
title: Sample Webservice
description: Webservice for Sample project
…

Rashid
- 1,700
- 1
- 23
- 56
1
vote
0 answers
NSwag generated C# clientsyntax errors
NSwag generates a very strange output with plenty of syntax errors (see sample below). Any ideas?
public virtual Response169 BusinessClassificationLovWhere(Country='')(Country2 country, int? top = null, int? skip = null, bool? count = null, string…

lstanczyk
- 1,313
- 13
- 20
1
vote
1 answer
NSwagStudio add custom typescript imports/lines
In my project I'm generating typescript clients via NSwagStudio.
To add credentails I have a BaseClient class that implements transformOptions.
export class MyClient extends BaseClient{...
Now I need to add following lines at the beginning of each…

SNO
- 793
- 1
- 10
- 30
1
vote
0 answers
Nswag Generate OpenApi Spec
I have a number of controllers marked with different versioning, and marked with corresponding documentName. This works fine, I can then generate my OAS spec. Using the following and specifying the appropriate documentName

JTIM
- 2,774
- 1
- 34
- 74
1
vote
0 answers
How to include additional models in swagger.json?
I have several public classes (models) in my API that are not being exposed through the controllers. Is there a way to get them manually or a keyword to expose them so that when I download the contract they show up? Without having to create dummy…

Sirus
- 382
- 1
- 8
- 35
1
vote
2 answers
Nswag/Angular display API error message in error event
First of All I was using the CQRS architecture for the back-end API and using NSWAG as an API connection; that generates API Endpoints in service proxy for the front-end Angular.
I did simple validation for my POST API, while testing the created API…

Marc Kenneth Lomio
- 429
- 1
- 4
- 11
1
vote
1 answer
NSwag generate single client class
When using NSwagStudio for generating C# client code (not in file) it generates the way that only one client class and corresponding interface is getting generated with all controllers methods in them.
However when trying to do the same thing with…

Grigoryants Artem
- 1,401
- 2
- 15
- 32
1
vote
1 answer
nswag command line generating proxy file not found
I have used NSwagStudio to generate client proxy in c#. I saved the project into an .nswag file. I have added it to my .net core console app. I then use the following command in package manager console
nswag.cmd run .\client.nswag…

pantonis
- 5,601
- 12
- 58
- 115
1
vote
1 answer
NSwagStudio how to save code generation settings
When generating C# client for web api via NSwagStudio there is an option to configure settings for achieving desired output. However after exiting the application and running it again you have to setup settings from scratch once again.
So I'm…

Grigoryants Artem
- 1,401
- 2
- 15
- 32
1
vote
1 answer
NSwagStudio and Swagger 2.0 x-sub_types
I think this is a NSwag or NSwagStudio question, but I'm not experienced enough with it to know if I'm using it wrong, or if there's a bug in NSwag or a problem with the Swagger 2.0 document I'm consuming.
I'm using NSwagStudio 13.6.1.0 to generate…

StackOverthrow
- 1,158
- 11
- 23