You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This example is produced if maxSampleDepth is greater than 4.
Possible Workaround/Solution
As a workaround, you can set maxSampleDepth to a higher number. It defaults to 15, but I ran into this because when its used in @stoplight/elements, elements happens to set the depth to 4. Patching my version of the elements web component resolved the issue there.
Steps to Reproduce
Run this javascript. Vary the maxSampleDepth to observe the bug
maxSampleDepth
doesn't always traverse schemas correctly. In some cases, it producesnull
in the example, instead of the actual type.Context
When the example shows
null
instead of the correct type, it is confusing to users of the API documentationCurrent Behavior
Given this schema:
Invoking the sampler like this:
Produces:
Expected Behavior
I would expect it to produce an example like this:
This example is produced if
maxSampleDepth
is greater than 4.Possible Workaround/Solution
As a workaround, you can set
maxSampleDepth
to a higher number. It defaults to 15, but I ran into this because when its used in@stoplight/elements
, elements happens to set the depth to 4. Patching my version of the elements web component resolved the issue there.Steps to Reproduce
maxSampleDepth
to observe the bugEnvironment
@stoplight/elements
7.7.5The text was updated successfully, but these errors were encountered: