docusaurus-openapi-docs icon indicating copy to clipboard operation
docusaurus-openapi-docs copied to clipboard

Render model definitions

Open adamsoffer opened this issue 3 years ago • 4 comments

Is it possible to render model definitions from an openapi spec using this plugin? I noticed this is something redocusaurus plugin supports.

image

adamsoffer avatar Aug 24 '22 22:08 adamsoffer

:tada: Thanks for opening your first issue here! Welcome to the community!

Hi @adamsoffer, thanks for the suggestion. I am familiar with how ReDoc and Swagger UI render models. That said, I don't have any personal experience actually using them. Can you describe how you use model definitions or how they would improve the experience for someone else?

Note: our plugin attempts to fully resolve schemas, including following any $ref pointers and merging allOf. The final representation of the schema should, in effect, be a representation of the model/component.

sserrata avatar Aug 25 '22 20:08 sserrata

Hi @sserrata. I'm also interested in support for model definitions. At SailPoint, we use model definitions in our Event Triggers API collection to expose the input/output schemas for each trigger. Model definitions help us document the input/output schemas of each trigger directly in the open API spec in a way that they can be linked to. For example, we have two places we link to our trigger models: In the description of the Trigger collection, and in the extended docs for each trigger. Model definitions also allow us to define a schema in one place rather than redefining it in the extended docs and the API spec.

colin-mckibben-sp avatar Sep 12 '22 18:09 colin-mckibben-sp

Thanks @colin-mckibben-sp, I appreciate the additional context and link to examples. I downloaded the SailPoint API spec for reference. I think it's something we can support but I am not certain that every user will necessarily want to generate models in all cases.

That said, we might explore introducing a CLI option like --include-models or -m that determines whether or not to generate them. Additionally, I think it makes sense to group/keep all the models together under a category. That or we can explore generating a separate sidebar slice just for the models.

sserrata avatar Sep 12 '22 18:09 sserrata

@sserrata Has there been any progress on this?

daltonconley avatar Nov 14 '22 15:11 daltonconley

Hi @daltonconley, nothing yet. Hoping to get started on this one for the next minor release.

sserrata avatar Nov 14 '22 21:11 sserrata

  • 1 for this one

etiennea avatar Jun 14 '23 07:06 etiennea

Now available in both v2.1.3 and 3.0.0-beta.10

sserrata avatar Mar 27 '24 19:03 sserrata