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.

OpenApi schema field descriptions containing new lines

See original GitHub issue

Hi,

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

image

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:closed
  • Created 2 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
Zaid-Ajajcommented, May 10, 2021

Hi @Numpsy as of latest source, enum types (with enum names), enum flags (without names) and allOf references are handled (for inheritance). Please give it a try and see if I missed something other than oneOf and the client generation

1reaction
Zaid-Ajajcommented, May 6, 2021

Hi @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.

Read more comments on GitHub >

github_iconTop 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 >

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