Introduce XSD to JSON Schema generator #378
Merged
chathuranga-jayanath-99 merged 9 commits intowso2:mi-ext-v2-ls-alphafrom Mar 25, 2025
Merged
Conversation
thuva9872
reviewed
Mar 24, 2025
thuva9872
reviewed
Mar 24, 2025
thuva9872
reviewed
Mar 24, 2025
thuva9872
reviewed
Mar 24, 2025
thuva9872
reviewed
Mar 24, 2025
thuva9872
approved these changes
Mar 24, 2025
ce65958 to
145ffc3
Compare
thuva9872
approved these changes
Mar 25, 2025
145ffc3 to
24af6b5
Compare
thuva9872
approved these changes
Mar 25, 2025
fd120db
into
wso2:mi-ext-v2-ls-alpha
2 checks passed
This file contains hidden or 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
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.
Purpose
This PR introduces support for the data mapper to handle input and output from an XSD schema. To enable this functionality, it includes the necessary changes to generate a corresponding JSON schema from the XSD schema.
This update introduces support for handling both Complex and Simple types in the XSD schema through specialized processors:
ComplexTypeProcessorandSimpleTypeProcessor.Complex Type Example
Simple Type Example
For JSON schema generation, we introduce the
JsonSchemaNodeclass as the parent class, with the following subclasses to handle different schema elements:JsonSchemaArrayNode: Represents an array in the JSON schema.JsonSchemaObjectNode: Represents an object type node in the JSON schema.JsonSchemaElementValueNode: Represents an object type node for elements that accept both values and attributes in the XSD.JsonSchemaOneOfNode: Represents an object withoneOffield containing multiple schema objects .These changes provide a structure for processing and generating both XSD and JSON schema representations.