kommentaar icon indicating copy to clipboard operation
kommentaar copied to clipboard

Allow adding `description` to Responses

Open adrianlungu opened this issue 2 years ago • 1 comments

Additional information may be useful (we have some use cases) in the description of the Responses.

I have some preliminary work in a fork on this where I changed the response regex to allow adding a description after the type of the response, i.e.

Screenshot 2022-03-22 at 11 16 20

However, the status and meaning are still replicated, which I'm thinking of taking out and just leaving the description.

adrianlungu avatar Mar 22 '22 09:03 adrianlungu

What do you guys think of this as the ResponseHeader regex ?

^Response( (\d+?))?( \((.+?)\))?: ([^\s]+)?(.\s*?\[((.|\s)*?)\])?

It should keep existing response headers working as previously while allowing to also add Description to the spec as such:

Response 400 (text/plain): {data} [some description 
can be written here as multiline allowing 
for clarification regarding the meaning of this response
]
Response 401 (text/plain): {empty} [or it can be a oneliner]
Response 402 (text/plain): {empty}

adrianlungu avatar Mar 29 '22 07:03 adrianlungu