<?php
if($redoc_load) {
echo "<redoc spec-url='$path_to_yaml'></redoc>";
echo "<script src='https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js'> </script>";
}
else {
echo "<p>Please specify a proper file. The file specified is missing or there is no file specified.</p>";
}
?>
</div>
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Latest Redoc doesn't generate XML request bodies #492
Comments
Exactly! +1 |
@gerbil I just included the example request in the description of the endpoint for the time being. It's not near as nice, but it serves the stopgap measure until it's either fixed or I get around to migrating off redoc. |
@tmarkovich can you post a full example here? i'm quite new to this kind of things.. |
Hey @tmarkovich, @gerbil this can be workaround-ed. You can put example into components:
# ...
requestBodies:
# Vertex RequestBodies
VertexIn:
content:
application/json:
schema:
allOf:
- description: The vertex to read in
title: Vertex
- $ref: '#/components/schemas/VertexIn'
application/xml:
# v=========v note example below
example: |
<?xml version="1.0" encoding="UTF-8">
...
</xml>
schema:
allOf:
- description: The vertex to read in
title: Vertex
- $ref: '#/components/schemas/VertexIn'
description: The vertex to add to the graph
required: true Let me know if this is what satisfies your use case! Automatic XML sample is not planned for the near feature. |
Custom response examples are being rendered as a hash map of characters instead of text:
|
Is this because im using |
It appears so... Would be nice to be able to use a ref here. |
But it will unnecessary increase the size of our specification @RomanHotsiy |
@RomanHotsiy I just want to know how to add the XML content type support in ReDoc. |
I am having this same issue. My openapi/swagger file is generated by Swashbuckle (.Net) and I cannot see how I'd add an XML example in the code base; let alone the whole point being that swagger is supposed to solve documentation getting out of step from the code (and adding in manual examples sounds like a recipe for disaster here). |
Our project uses both XML and JSON, but I am unable to see the XML request body in the documentation. Has anyone had any luck with this? |
Any progress on this? Or has anyone been able to override the default behaviour to provide support for XML request / response body generation? As far as I can tell the code responsible lives here: redoc/src/services/models/MediaType.ts Line 49 in 7e4639e
|
+1 for this feature. Would love to see response rendering of our server's XML responses. |
This feature has been implemented (at least for response examples) in #2347 and could be reused for requests. |
I am trying to document an API that uses a REST request interface and produces an application/atom+xml response. Is there a workaround to provide examples, since only application/json generates code examples? Allowing application/atom+xml as a content type with the workaround will help. |
I'm attempting to use redoc to generate documentation for an API that takes both XML and JSON requests, but it appears that redoc isn't able to generate samples for the requestBodies of type
application/xml
.Here is a minimal YAML file:
and using
I get the following output:
By contrast, when I use the same YAML file in the editor at
https://editor.swagger.io
, I get the output that I'd expect:Is there a way to get redoc to generate the desired XML requestBody samples?
The text was updated successfully, but these errors were encountered: