[ZEN-3764] Example Data: Generate example dummy data into OpenAPI Model from single schema (DO NOT MERGE) #487
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 PR add's support for providing example data in the KZOE editor, in the form of a proposal provider. It introduces a new extension point named com.reprezen.swagedit.core.exampleprovider. Plug-ins having a dependency on com.reprezen.swagedit.core can provide an extension to the aforementioned extension point. The extension receives a resolved schema instance as input, which can be used with libraries like Adobe Ride (model-util), JSON Schema Faker... to generate dummy data.
It also enhances the internal utility API by adding two new classes - ModelUtils and ExtensionUtils. ModelUtils has API for traversing the JSON Node model (AST) and retrieving nodes with a given name. The ExtensionUtils adds support for reading extension points.
JsonExampleProposalProvider
is the base class of the newly introduced example providers for Swagger and OpenAPI 3.0. The implementationsOpenApi3ExampleProposalProvider
andSwaggerExampleProposalProvider
provide intelligence of identifying the content assist location and retrieving the ExampleProvider implementation.