SlideShare a Scribd company logo
Ankit Lawaniya
 The JSON Schema validator evaluates JSON payloads at runtime
and verifies that they match a referenced JSON schema. We can
match against schemas that exist in a local file or in an external
URI.
 If the payload is not compliant with JSON schema then we will get
the below Exception:
org.mule.module.json.validation.JsonSchemaValidationException: Json
content is not compliant with schema
This feature is specially useful when we are consuming a service that
expects JSON inputs and that must match a specific schema. Only the
JSON payload which is successfully validated against schema will pass
through otherwise JSON schema validation exception will be raised.
Syntax:
<json:validate-schema schemaLocation="EmployeeSchema.json"
doc:name="Validate Json Schema" />
Let’s walk through how to use JSON Schema validator in Mule
application.
Using the JSON Schema Validator is very simple: We only need to
provide a reference to the schema file you want to validate against on
schemaLocation. The Schema Validator accepts both local and external
resources.In this example we have "EmployeeSchema.json" located in
src/main/resources folder . We are expecting the JSON payload as part
of the request which will be validated aganist the schema.
Validate json schema component
Validate json schema component
Success Request:
{
"firstName": "Ankit",
"lastName": "Lawaniya",
"age": 28
}
Failed Request:
{
"firstName": "Ankit",
"age": 28
}
Validate json schema component

More Related Content

PPTX
Creating dynamic json
PPTX
Scheduling and monitoring with java in mule
PPTX
Validate Soap Request in Mule
PPTX
Soap In Mule
PPTX
Mule soap
PPTX
Accessing jms in mule using groovy
PPTX
Soap in mule
PPTX
Validating a soap request in mule
Creating dynamic json
Scheduling and monitoring with java in mule
Validate Soap Request in Mule
Soap In Mule
Mule soap
Accessing jms in mule using groovy
Soap in mule
Validating a soap request in mule

What's hot (8)

PPTX
Simple web service vm
PPTX
Creating dynamic json in Mule
 
PPTX
Mule soap
PPTX
Soap request in mule
PPTX
Schema validation filter (xml schema validation)
PPTX
Increase automation to rest
PPTX
Validate soap request in mule
PPTX
Caching and invalidating with managed store
Simple web service vm
Creating dynamic json in Mule
 
Mule soap
Soap request in mule
Schema validation filter (xml schema validation)
Increase automation to rest
Validate soap request in mule
Caching and invalidating with managed store
Ad

Similar to Validate json schema component (20)

PPTX
Using JSON Schema Validator
PPTX
Validate json schema
PPTX
Mule JSON Schema Validator
PPTX
#speakgeek - Angular JS
PPTX
Automated testing with selenium prasad bapatla
PPTX
Json
PDF
AWS Application Load balancer
PPTX
Validating a soap request in mule
PPTX
Validating soap request in mule
PPTX
Validating a soap request in mule
PPTX
Validating a soap request in mule
PPTX
Validate soap request in mule
PPTX
Validating soap request in mule
PPTX
Validate soap request in mule
PPTX
Creating dynamic json in mule
PPTX
Creating dynamic json
PPTX
Creating dynamic json
PPTX
Creating dynamic json
PPTX
Creating dynamic json
Using JSON Schema Validator
Validate json schema
Mule JSON Schema Validator
#speakgeek - Angular JS
Automated testing with selenium prasad bapatla
Json
AWS Application Load balancer
Validating a soap request in mule
Validating soap request in mule
Validating a soap request in mule
Validating a soap request in mule
Validate soap request in mule
Validating soap request in mule
Validate soap request in mule
Creating dynamic json in mule
Creating dynamic json
Creating dynamic json
Creating dynamic json
Creating dynamic json
Ad

More from Ankit Lawaniya (11)

PPTX
Content based routing using mule choice flow control
PPTX
Until successful scope in mule
PPTX
First successful-router
PPTX
Iterative processing using the for each scope in
PPTX
Improving performance with cache scope in mule
PPTX
Cors (cross origin request sharing) in mule
PPTX
Content enrichment using mule message enricher
PPTX
Validation module in mule
PPTX
Parse template transformer mule
PPTX
Active mq read and write flow in mule
PPTX
Composite source in mule
Content based routing using mule choice flow control
Until successful scope in mule
First successful-router
Iterative processing using the for each scope in
Improving performance with cache scope in mule
Cors (cross origin request sharing) in mule
Content enrichment using mule message enricher
Validation module in mule
Parse template transformer mule
Active mq read and write flow in mule
Composite source in mule

Recently uploaded (20)

PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
Spectroscopy.pptx food analysis technology
PDF
Empathic Computing: Creating Shared Understanding
PDF
Approach and Philosophy of On baking technology
PPTX
Cloud computing and distributed systems.
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Big Data Technologies - Introduction.pptx
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
sap open course for s4hana steps from ECC to s4
Understanding_Digital_Forensics_Presentation.pptx
Spectroscopy.pptx food analysis technology
Empathic Computing: Creating Shared Understanding
Approach and Philosophy of On baking technology
Cloud computing and distributed systems.
“AI and Expert System Decision Support & Business Intelligence Systems”
MYSQL Presentation for SQL database connectivity
Review of recent advances in non-invasive hemoglobin estimation
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Building Integrated photovoltaic BIPV_UPV.pdf
Unlocking AI with Model Context Protocol (MCP)
Digital-Transformation-Roadmap-for-Companies.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Encapsulation_ Review paper, used for researhc scholars
Big Data Technologies - Introduction.pptx
NewMind AI Weekly Chronicles - August'25 Week I
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
sap open course for s4hana steps from ECC to s4

Validate json schema component

  • 2.  The JSON Schema validator evaluates JSON payloads at runtime and verifies that they match a referenced JSON schema. We can match against schemas that exist in a local file or in an external URI.  If the payload is not compliant with JSON schema then we will get the below Exception: org.mule.module.json.validation.JsonSchemaValidationException: Json content is not compliant with schema
  • 3. This feature is specially useful when we are consuming a service that expects JSON inputs and that must match a specific schema. Only the JSON payload which is successfully validated against schema will pass through otherwise JSON schema validation exception will be raised. Syntax: <json:validate-schema schemaLocation="EmployeeSchema.json" doc:name="Validate Json Schema" />
  • 4. Let’s walk through how to use JSON Schema validator in Mule application. Using the JSON Schema Validator is very simple: We only need to provide a reference to the schema file you want to validate against on schemaLocation. The Schema Validator accepts both local and external resources.In this example we have "EmployeeSchema.json" located in src/main/resources folder . We are expecting the JSON payload as part of the request which will be validated aganist the schema.