Forum Discussion

breaux's avatar
breaux
Contributor
3 years ago

Documentation Export with inherited types is incorrect

I have an openapi: 3.0.0 API where I've used type inheritance for some requests & responses, and when I view those in the SwaggerHub editor or viewer, they look as I want/expect: all the fields collapsed into a flat object:

 

But when I export the file to HTML, I instead get a very confusing view of all the nested "all of" elements.

How can I get the exported documentation to look like the online documentation in this regard?

2 Replies

  • Hi breaux ,

     

    The reason it looks different is because the first picture is an Open API document being rendered using Swagger UI (within SwaggerHub), and the second picture is an HTML file created by SwaggerHub. 

     

    To view your API doc the same way you do in SwaggerHub, you'll want to download the YAML file from SwaggerHub, and use SwaggerUI to render your document. 

    https://swagger.io/tools/swagger-ui/

     

    Hope this helps,

    Alex

    • breaux's avatar
      breaux
      Contributor

      So I can't export HTML and get a flat display of the types? That would make me quit using hierarchical types. I don't want viewers of my HTML exports to have to be exposed to that confusing syntax 😞

       

      (Just to be clear, I'm not talking about the pretty formatting/display, but about the exposure of the internal type hierarchy with each method.)