简体   繁体   中英

Is it possible to pass an OpenAPI spec as a JSON object to ReDoc?

I created an OpenAPI JSON document for a RESTful service and am using ReDoc to display it.

Is there a way to pass the OpenAPI spec as a JSON object directly to ReDoc without using a JSON file or URL?

<!DOCTYPE html>
<html>
  <head>
    <title>ReDoc</title>
    ...
  </head>
  <body>

    <redoc spec = {{object}} ></redoc>  <----------- Is this possible?

    <script src="/doc/bundles/redoc.standalone.js"> </script>
  </body>
</html>

Yes. You could pass json object or a URL.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM