[ASP.NET Core] Operation now returns StatusCode Stubs as well#7098
[ASP.NET Core] Operation now returns StatusCode Stubs as well#7098wing328 merged 6 commits intoswagger-api:masterfrom
Conversation
|
@knom Thanks this is a really helpful addition. My only comment is more of a question (or suggestion). Rather than returning actual code, couldn't we just document the returns as todos themselves, for example: Reason I ask is because many people use static code analysis and |
|
@jimschubert: Should I update it or will you? |
|
@knom If you could, it would be faster. I don't have push access to the repo. I really appreciate the contributions! |
return StatusCode(..) is now commented out.
|
@jimschubert all done! |
default(dataType) --> default(&dataType)
| { {{#responses}}{{#dataType}} | ||
| //TODO: Uncomment the next line to return response {{code}} or use other options such as return this.NotFound(), return this.BadRequest(..), ... | ||
| // return StatusCode({{code}}, default({{&dataType}})); | ||
| {{/dataType}}{{^dataType}} |
There was a problem hiding this comment.
@knom Please use the following instead to allow empty lines with spaces:
{{#dataType}}
...
{{/dataType}}
{{^dataType}}
....
{{/dataType}}
|
@knom please run |
|
Just updated the formatting! Your comment wasn't fully clear to me.. THANKS! |
| "Newtonsoft.Json": "9.0.1" | ||
| "Newtonsoft.Json": "10.0.3", | ||
| "JsonSubTypes": "1.1.3" | ||
| }, |
There was a problem hiding this comment.
This is not part of my updates.. note sure why this is changing...
| [EnumMember(Value = "sold")] | ||
| SoldEnum | ||
| SoldEnum = 3 | ||
| } |
There was a problem hiding this comment.
This is not part of my updates.. note sure why this is changing...
| [EnumMember(Value = "placed")] | ||
| PlacedEnum, | ||
| PlacedEnum = 1, | ||
|
|
There was a problem hiding this comment.
This is not part of my updates.. note sure why this is changing...
| /// Add a new pet to the store | ||
| /// </summary> | ||
| /// <remarks></remarks> | ||
|
|
There was a problem hiding this comment.
This is not part of my updates.. note sure why this is changing...
Yup, sorry that I wasn't clear. |
@mandrean @jimschubert
#7097
This uses this.StatusCode(..) to render more verbose STUBS for the Controllers.
So people that are less familiar with ASP.NET Core can understand how it works..