JSON Schema is a detail for a JSON-based organization for characterizing the structure of JSON information. It approves input information at runtime and checks that they coordinate a referenced construction or not. We can coordinate against characterized compositions that exist in a neighborhood document or in an outer URI.
On the off chance that the payload is wrong with given JSON mapping, at that point compiler tosses the beneath special case:
org.mule.module.json.validation.JsonSchemaValidationException: JSON content isn't agreeable with an outline. MuleSoft Online Training Hyderabad
Utilize Case
Approving the information JSON payload against with JSON Schema.
JSON Payload:
Donkey Flow
Stage 1:
Arrange the HTTP Listener with by giving hostname, port number and way alongside this indicate permitted strategies (Optional) at an Advanced tab of HTTP connector.
Stage 2:
Intuitive the JSON Validate Schema from Mule Palette to approve the info payload. Furthermore, give the composition way. For my situation it resembles beneath:
From the above line,
patterns - > It is an index
Test Schema.json - > It is JSON-Schema structure for approval.
Punctuation of JSON Validator as underneath:
Stage 3:
Intuitive the Logger part to log the resultant payload after the approval.
Final Config.xml:
Success Scenario:
Failure Scenario:
On the off chance that the payload is wrong with given JSON mapping, at that point compiler tosses the beneath special case:
org.mule.module.json.validation.JsonSchemaValidationException: JSON content isn't agreeable with an outline. MuleSoft Online Training Hyderabad
Utilize Case
Approving the information JSON payload against with JSON Schema.
JSON Payload:
JSON Schema:
Donkey Flow
Stage 1:
Arrange the HTTP Listener with by giving hostname, port number and way alongside this indicate permitted strategies (Optional) at an Advanced tab of HTTP connector.
Stage 2:
Intuitive the JSON Validate Schema from Mule Palette to approve the info payload. Furthermore, give the composition way. For my situation it resembles beneath:
From the above line,
patterns - > It is an index
Test Schema.json - > It is JSON-Schema structure for approval.
Punctuation of JSON Validator as underneath:
Stage 3:
Intuitive the Logger part to log the resultant payload after the approval.
Final Config.xml:
Success Scenario:
Failure Scenario:
Thank you!
Please feel free to share your thoughts in the comments section. more details visit the mulesoft online training
No comments:
Post a Comment