-
Notifications
You must be signed in to change notification settings - Fork 297
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
JsonSchemaViewer does not respect showSideNav attribute. #781
Comments
OpenAPI do not support documenting WebSocket. So unfortunately you cant And Still if you like to document WebSockets using OpenAPI, IMO using markdown and use a table or code-block in descriptions to document your schemas and related details. That way you can have the entire spec in one document. And the other option would be to use AsyncAPI to document your REST API and WebSocket both in a single place |
Well, I didn't suggest or ask for WebSocket support. I'm just asking if it's possible to render any json schema to the description.
If you have intend to publish a component in the future. |
okay I will add this to our queue as a feature request. to allow usage of |
@nnaku how were you able to pass the schema via the data URL? I'm trying the same and getting error {
errors: [],
resolvedSpec: { /* my correctly decoded json schema */ },
spec: {}
} |
@shishkin here is how i got it working. Its from internal tool so no live example sorry... const markdownTemplate = ({title, description, spec}) => `
### \`${title}\`
${description}
<div class="event-schema" style="height: auto;">
<json-schema-viewer
spec-url="data:;base64,${Buffer.from(JSON.stringify(spec), 'utf8').toString('base64')}"
theme="light"
show-side-nav="false"
show-header="false"
show-info="false"
allow-search="false"
allow-advanced-search="false">
</json-schema-viewer>
</div>
` |
OK, after some debugging it seems the issue I had wasn't with the base64 data URL encoding, but with the expected spec format. From this mongo example and the parser logic I see that jsonSchemaViewer: 1.0.0
schemaAndExamples:
// real schema goes in here Is this some kind of standard? Can the |
it isnt any standard those are the sections reserved for the component and in future there may be additional sections added. just accepting a json is too limiting |
I'm trying to inject following html to tag description. Theme and header attributes works as expected but I cannot hide the side nav.
And why? Well, we have websocket on same server and I like to just list event payloads in description. Keeping all the stuff in same apidoc feels better than docs scattered all over the places.
The text was updated successfully, but these errors were encountered: