stoplightio / json-schema-viewer

A JSON Schema viewer React component
Apache License 2.0
175 stars 37 forks source link

feat: better support of anyOf/oneOf + type scenario #88

Closed P0lip closed 3 years ago

P0lip commented 4 years ago

Requires https://github.com/stoplightio/json-schema-viewer/pull/86

Closes_ https://github.com/stoplightio/platform-internal/issues/4382

P0lip commented 3 years ago

@marbemac this is very likely to break masking. Shall we hide it behind a flag or something? Is displaying an old view acceptable for masking view?

marbemac commented 3 years ago

this is very likely to break masking.

Hmm, what's the example(s) you're thinking of re what might break?

P0lip commented 3 years ago

Well, I'm confident the oneOf/anyOf + type scenario will be almost always broken, as property paths will be mismatched. We'd need to perform the same kind of merging on the backend side of masking for the paths to match.

P0lip commented 3 years ago

I kicked of another project called @stoplight/json-schema-tree that is supposed to take out of all the schema processing logic we have in JSV - do note that although the logic is more or less similar, it's been vastly refactored to payback the debt we have in JSV. We'll be able to share it between masking & jsv, and possibly JSE. This will significantly simplify JSV making contributions much easier, in particular when it comes to plain UI changes.

P0lip commented 3 years ago

@stoplightio/void-crew anyone? it's ready.

billiegoose commented 3 years ago

@stoplightio/void-crew anyone? it's ready.

What do you mean by "ready" exactly? Is it still going to break masking?

P0lip commented 3 years ago

Yeah, it might break it at times but what Marc said. It's a rare scenario. Currently we don't display anything in such case so masking doesn't really work anyway.

stoplight-bot commented 3 years ago

:tada: This PR is included in version 3.0.0-beta.37 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

stoplight-bot commented 3 years ago

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

The release is available on:

Your semantic-release bot :package::rocket: