Skip to content

Support for rendering individual JSON schema #253

Description

@proppy

It would be nice to support rendering vanilla JSON schema in addition to OpenAPI specs.

Looking at the implementation of <schema-tree> and <schema-table>, it seems that they currently get an intermediate representation of the schema thru their .data attributes.

Do you think it would be desirable to extend those components to allow passing a JSON schema thru the element body, or would you rather see another component by introduced, ex:

<rapi-schema>
   <pre>
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "http://example.com/product.schema.json",
  "title": "Product",
  "description": "A product from Acme's catalog",
  "type": "object",
  "properties": {
    "productId": {
      "description": "The unique identifier for a product",
      "type": "integer"
    }
  },
  "required": [ "productId" ]
}
   </pre>
</rapi-schema>

(using a <pre> would allow to fallback to just displaying the raw schema.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions