Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C# client response class names are not matching the titles as specified in the openapi doc #4912

Open
sconnon-repay opened this issue Jun 11, 2024 · 1 comment

Comments

@sconnon-repay
Copy link

NSwag version: command line tools v14.0.7, dotnet6 (also present on older versions)
Operation: generate C# client
Issue: response class names are not matching the titles as specified in the openapi doc

Hi,
I am running the command line tools to generate a C# client.
I am just using a default .nswag file as generated by NSwag studio
The endpoint I am targeting has 2 success responses for 200 and 201 http response codes
If I run this on an openapi doc where the endpoint has more than 1 success schema, then the name of the output classes get renamed:

  • ValueFor200 => Response
  • ValueFor201 => Response1

Note: If I remove one of the success responses from the openapi doc, then the remaining class name is preserved

The command I am running is: dotnet .\path\to\dotnet-nswag.dll run .\path\to\nswag.nswag.json

I have attached the openapi doc and nswag config

nswag.nswag.json
rest-spec.json

@sconnon-repay
Copy link
Author

I have a fix for this.
I can't figure out what the contributing guidelines are.

Let me know if you want me to push somewhere

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant