question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Swagger example models not take DataContract.DataMember.Name override

See original GitHub issue

For example, when i set attribute for action

[HttpPost]
[SwaggerResponse(HttpStatusCode.Created, typeof(Product))]
public async Task<IActionResult> CreateProduct([FromBody] MutableProduct model)
{
}

i get wrong Response Class (Status 200) description in Swagger UI interface. But when i call this method - response is correct.

I use NSwag 11.17.2.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
LeonidEfremovcommented, Jan 22, 2019

Problem was in inheritance, my bad =(

0reactions
RicoSutercommented, Apr 28, 2018

So what was the problem?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Net Core display DataMember name in Swagger
I have a request of displaying the name from DataMember attribute in the request body of Swagger, instead of displaying the property name....
Read more >
DataContractAttribute Class (System.Runtime.Serialization)
By overriding the default values, you can reuse your existing type and have the serialized data conform to the data contract. Note. In...
Read more >
How To Serialize Nonstandard Enum Values
Integrating with third-party systems occasionally require enum values that are invalid .NET enum names. This article illustrates how to get ...
Read more >
Swashbuckle rename Data Type in Model
It's working fine on the members of the class but I was wondering if it was possible to override the class name as...
Read more >
Declarative Dev Model using Attributes
A great way to get a quick overview of what annotated DTOs looks like in practice ... as DTO Type and change serialization...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found