-
-
Notifications
You must be signed in to change notification settings - Fork 124
Closed
Labels
Description
Reason/Context
Traversing through JSON schemas with nested structure is not an easy task and requires a good knowledge of JSON Schema. The parser should make it easy especially that it already has a needed logic for anonymous id's assignment to messages and schemas, or detection of circular references.
Description
- expose something like this on the API level
asyncapi.traverseSchemas(callback, schemaType)schemaTypewould by default traverse all schemas, but you could specify that you for example only wantpayloadschemas or onlyparametersschemascallbackwould be a function that you can pass into the traverse, that will be invoked on each schema found during
the traverse
- would be great if the callback execution result could be returned by the function
- refactor existing logic for traversing schemas. We cannot just expose 1:1 what we have. Current traversing logic cares directly for circular refs detection and marking schemas as circular during parsing. Would be good to not just repeat everything again when traversing through the document after it is parsed
- this is where the current traversing logic is located
Reactions are currently unavailable