RapiDoc icon indicating copy to clipboard operation
RapiDoc copied to clipboard

Feature request: Display schema name

Open aarjithn opened this issue 3 years ago • 3 comments
trafficstars

In OpenAPI Swagger UI, it is possible to view name of a Schema. This is very useful for us to define Type definitions in TypeScript.

Collapsed view

image

Expanded view

image

Rapidoc however shows the expanded JSON structure, and not Schema name itself. The name is not displayed even if object is collapsed. Is there a way to show the Schema name?

image

aarjithn avatar Jul 11 '22 06:07 aarjithn

SchemaName is very internal to the spec. We dont think it brings in much value to a reader of the document. Instead we opted to show a more cleaner and less noisy view of the Schema.

If you can provide me some compelling reason for an API user (not a spec developer) to know about Schema Names used inside the spec I will take it forward to the discussion table

mrin9 avatar Jul 12 '22 17:07 mrin9

@mrin9 Agree that if you are just calling the API as json it is not much of value.

It is useful for us because we try to keep the Typescript types in sync with the Schema name so that same schema type gets reused across multiple APIs.

It can be an option which is disabled by default, but having this option would be helpful for UI Developers who use Typescript to type the responses.

Ofcourse it won't be required if one is auto-generating d.ts from openapi yaml files, but in my experience that is not common as manual typing.

An example of how it could look:

image

aarjithn avatar Jul 13 '22 13:07 aarjithn

We do have seen schemas composed of many other schemas, which will result into having these names embedded in between too and not just at the top. The other challenge is when you have to show a complex composition made with one-of , any-of constructs both in terms of space usage on narrow screen devices.

I will take it further to discuss with the team let see what they have to say about this

mrin9 avatar Jul 13 '22 14:07 mrin9

+1 for feature

Igreh avatar Dec 22 '22 08:12 Igreh