OpenApi schema field descriptions containing new lines
See original GitHub issueHi,
A small possible issue I noticed by accident when testing something.
Say that I have an OpenApi schema that contains something like
"status": {
"type": "string",
"description": "pet status\r\nin the store",
"enum": [
"available",
"pending",
"sold"
]
}
Then i get this for the generated type

Which looks like the doc comment has been split over two lines, when I guess it should be collapsed in to one, or have /// on both lines? (fwiw, I have a couple of schemas that are generated from ASP.Net Core services which do that if a comment on the .NET type is multi-line).
Thanks.
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
Add a newline to swagger output - java
Swagger shows a newline when the first method above is used when using the notes parameter for the other annotations (doesn't work with...
Read more >Format Swagger Text Descriptions
A quick and practical guide to formatting Swagger descriptions.
Read more >Adding Examples
You can add examples to parameters, properties and objects to make OpenAPI specification of your web service clearer. Examples can be read by...
Read more >Step 2: The info object (OpenAPI tutorial)
The info object contains basic information about your API, including the title, a description, version, link to the license, link to the ...
Read more >Adding Examples
Examples can be used by tools and libraries, for instance, Swagger UI auto-populates request bodies based on input schema examples, and some API...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Hi @Numpsy as of latest source, enum types (with enum names), enum flags (without names) and
allOfreferences are handled (for inheritance). Please give it a try and see if I missed something other thanoneOfand the client generationHi @Numpsy this should be an easy fix I think. We can split the description over multiple lines.
It would be awesome if you could share the schema you have or an anonymised version of it where you rename fields or remove descriptions. It would make for a good example to test this project with since I don’t have proper sNSwag schema’s to work with.