poem
poem copied to clipboard
[Swagger UI] Markdown codeblocks in description trims indentation
Expected Behavior
Indentation similar to how it is rendered in markdown, cargo doc
, rust analyzer, here on Github
[
{
"id": 1,
"value": {
"Secret": "Password"
}
},
{
"id": 2,
"value": {
"HashPreimage": "Secret Value"
}
}
]
Actual Behavior
Removal of any indentation in code blocks:
I'm not sure if that is a fundamental limitation of swagger or something related to poem-openapi reading the docstring.
Steps to Reproduce the Problem
- Create an API with the above shown markdown in the docstring (shown as the description in swagger)
- Create a server with
let ui = api_service.swagger_ui();
and.nest("/ui", ui)
- Go to the swagger UI and look at the documentation of the function created.
Example:
/// ### Example value
/// ```
/// [
/// {
/// "id": 1,
/// "value": {
/// "Secret": "Password"
/// }
/// },
/// {
/// "id": 2,
/// "value": {
/// "HashPreimage": "Secret Value"
/// }
/// }
/// ]
/// ```
#[oai(
path = "/session/:session_id/keys/:id",
method = "get",
)]
async fn get_key(
Specifications
- Version: 4.0.0
- Platform: Linux
- Subsystem: poem-openapi