-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ZEN-3764] Example Data: Generate example dummy data into OpenAPI Model from single schema (DO NOT MERGE) #487
Open
nbhusare
wants to merge
19
commits into
master
Choose a base branch
from
task/ZEN-3764
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…nded in the studio in order to provide a dummy data provider for json schema. The ExampleDataProvider is an interface that the implementation data provider would extend. The content assist processor binds the new content assist extension. The ExampleDataContentASsistExt provides an extension to the content assist at position definitions/any. The schemas folder is made available as part of the binary buld by adding it in the build file
Updated the ExampleDataContentAssistExt class to get the Schema object and resolve it before passing to the extendion implementation
Added new Utility API namely ExtensionUtils and ModelUtils
…pi3ExampleProposalProvider which gets trigger when the user hits content assit at a location where example or examples/example-name/value is required. It internally calls the ExampleDataProvider to get the example data. Reverted back the changes made to the existing codebase
Added copyright to new files
…oved to the swagedit.core project so that they can be reused in Swagger and OpenApi3 propesalproviders
Renamed the schema file too Moved the ExamplePovider to the core.exampleprovider package inside the swagedit.core project
…gic from Swagger and OpenAPI3 proposal providers Added separate Proposal providers for swagger and openapi3
ADded initial unit test- wip
Fixed merge conflicts in swagedit.core plugin.xml and the ExtensionUtils class Renamed the extension point for example provider to c.r.swagedit.exampleprovider Minor changes in the .exsd file
Updated the ExampleProvider interface
ghillairet
reviewed
Apr 10, 2019
@@ -5,4 +5,5 @@ bin.includes = META-INF/,\ | |||
OSGI-INF/,\ | |||
plugin.xml,\ | |||
icons/,\ | |||
resources/ | |||
resources/,\ | |||
schema/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nbhusare You should remove this schema
it is making the build to fail.
… removed it from the build.properties bin.includes field
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.