Redoc: ReDoc generates "Request samples" for request body but not for query string

Created on 26 Feb 2018  路  3Comments  路  Source: Redocly/redoc

ReDoc automagically generates a request sample using the schema provided to describe the request body, which is nice. However, it does not generate such examples for query parameters.

Maybe I'm doing things wrong. Feel free to requalify as question or feature request.

Most helpful comment

Maybe in the request samples section, where you currently have that code block with the body example, along with copy / expand all / collapse all shortcuts, you could have another code block above with the URL example.

It could look pretty much like the current URL line, even with the dropdown that shows the URL including the protocol://host:port URL part. The only thing that bothers me is that it would look so close to the URL bar it would seem redundant.

Also, I just realized this is not only about query string parameters but also path parameters.

All 3 comments

There seems to be a discrepancy in the treatment of body and query string.

If I add example attributes to the fields of the body schema, those are used to populate the request or response sample in the right side column. But they are not displayed in the request body or response schema sections of the central column.

However, example attributes added to query string parameters are displayed in the central section, but no sample is generated in the right column.

@lafrech how do you envision query string samples to be displayed in the right column? Could you share your ideas?
btw these samples will be used once we add CURL samples.

Maybe in the request samples section, where you currently have that code block with the body example, along with copy / expand all / collapse all shortcuts, you could have another code block above with the URL example.

It could look pretty much like the current URL line, even with the dropdown that shows the URL including the protocol://host:port URL part. The only thing that bothers me is that it would look so close to the URL bar it would seem redundant.

Also, I just realized this is not only about query string parameters but also path parameters.

Was this page helpful?
0 / 5 - 0 ratings