Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes an issue we were seeing where large schemas would have missing properties in the examples.
Previously, because
options
are shared between recursive calls, only a maximum of 100 properties would be rendered in total. (It would be less if$ref
are used, because the indirection counts towards the limit).Since the fix in #190 prevents circular examples from ending in an infinite loop, I removed the "depth" check. I've tested it with the referenced billing.yaml example and it works fine. If you prefer I can leave it in, though since it now truly checks for depth, 100 would be a pretty high limit, so I don't think it adds anything.
Also if the same
$ref
is used multiple times in the same schema, even if not recursive, it would previously only render the first occurrence.Here's an example of billing.yaml before and after:
Notice that
id
was missing in a lot of places because it is a$ref
and is used on the top level already, so it was not render it in nested objects.Recursive examples like this still work: (
Service
object which contains a nestedService
objectServicePeriod
which has nestedServicePeriod
)