Closed P0lip closed 4 years ago
This is 🔥.
One request - if you have not already, could you yalc this into platform v1 and manually inspect a wide variety of the sample-models
in explorer to make sure that JSV:
a) does not crash for any of them b) handles the complex use cases represented in that repo nicely
The only thing I'm not sure about is object[User]
. The []
kind of throws me off, since it's normally used for arrays. And it's not like when it is an array we show array[object[User]]
. Maybe we just show User
rather than object[User]
?
Also, I suggest that @mallachari does a pass on the code review.
This might be unrelated here but I also don't understand why is there an extra level of indentation in one of these cases:
$refs have one extra level of nesting unless you enable eager $ref resolving (which we do have enabled in elements - studio, explorer, docs), so it's not that important.
Basically, when you don't resolve $refs upfront, we retain them in the document, to be resolved later once you expand the row.
Upon expansion
With eager resolving enabled, this is how it looks like
It's fairly transparent to user - the rendered schema looks like there was no $ref at all. Having said that, the extra nesting level is for the sake of consistency. In our case, however, the effect is rather none, given we have the eager resolving option enabled, so in our case the schema will look like the latter example.
object - {name}
looks tad weird, but hm, getting rid of object
may be confusing for some.
Don't have any preference.
@marbemac what do you think about the proposal @mallachari posted?
How about object{User}
and array[User]
? In this case would drop the extra {4}
property counts, not sure how useful those really are in any case.
Or User
and User[]
?
Or User and User[]?
This looks good to me, but what about other types, i.e strings? array[string]
?
I went with It feels really cool. No title:
:tada: This PR is included in version 3.0.0-beta.25 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Looks great! The only small suggestion in the name of consistency might be object[]
, but we can visit this later - not a big deal.
:tada: This PR is included in version 3.0.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
General rules:
Before:
After:
Before:
After:
Before:
After:
Before (eager resolving enabled):
Before (eager resolving disabled):
After (eager resolving enabled):
After (eager resolving disabled):
Before (eager resolving enabled):
Before (eager resolving disabled):
After (eager resolving enabled): After (eager resolving disabled):
Remarks:
we do not support combiners at all (on purpose)
we do not display types for primitive types (on purpose)
we do not display titles for mixed types (on purpose)
arrays with defined items