stoplightio / json-schema-viewer

A JSON Schema viewer React component
Apache License 2.0
170 stars 36 forks source link

feat: add support for vendor extensions #245

Closed weyert closed 6 months ago

weyert commented 9 months ago

Motivation and Context

Adds support for rendering vendor extensions as part of a schema row or the top level schema

Fixes https://github.com/stoplightio/json-schema-viewer/issues/236

Description

Introduces support to custom renderer for vendor extensions, by adding a new property named renderExtensionAddon which will call when vendor properties (properties prefixed with x-) are find the schema definition.

How Has This Been Tested?

Tested in production for our internal documentation

Screenshot(s)/recordings(s)

Rendering of a vendor extension that shows the x-stoplight extension, in this example, it only returns a React element for any extensions with a nesting level higher than 0 CleanShot 2024-02-20 at 15 28 52@2x

Types of changes

Checklist

weyert commented 8 months ago

@billiegoose @daniel-white @brendarearden If someone could have a look at this would be great!

weyert commented 8 months ago

@P0lip Can you have a look?

weyert commented 8 months ago

Thanks, I will update the PR ASAP. I need to solve some work tasks first

weyert commented 7 months ago

@P0lip Sorry, I was on vacation for Chinese New Year. I have updated the PR now.

Please let me know, what you think of it :)

weyert commented 6 months ago

Anymore changes needed? I would love to be able to stop maintaining a fork of elements and json-schema-viewer cc @P0lip @billiegoose @daniel-white @brendarearden @kaylachun

P0lip commented 6 months ago

I'll merge it tomorrow. Apologies for dropping a ball - I had time off last week too.

weyert commented 6 months ago

Awesome excited 👯‍♀️ :) Thank you! 🙏

weyert commented 6 months ago

@P0lip Would you be able to merge it? Love to raise a PR in Elements to bump with this support :)

stoplight-bot commented 6 months ago

:tada: This PR is included in version 4.16.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

weyert commented 6 months ago

Awesome thank you 👯