public class ValidateJsonSchemaOperation extends Object implements org.mule.runtime.api.lifecycle.Disposable, org.mule.runtime.api.lifecycle.Startable, org.mule.runtime.api.lifecycle.Stoppable, org.mule.runtime.api.lifecycle.Initialisable
| Constructor and Description |
|---|
ValidateJsonSchemaOperation() |
| Modifier and Type | Method and Description |
|---|---|
void |
dispose() |
void |
initialise() |
void |
start() |
void |
stop() |
void |
validateSchema(String schema,
Object content,
Collection<SchemaRedirect> schemaRedirects,
JsonSchemaDereferencingMode dereferencing,
boolean allowDuplicateKeys,
boolean allowArbitraryPrecision)
Validates that the input content is compliant with a given schema.
|
public void start()
start in interface org.mule.runtime.api.lifecycle.Startablepublic void stop()
stop in interface org.mule.runtime.api.lifecycle.Stoppable@Validator @Execution(value=CPU_INTENSIVE) @Throws(value=SchemaValidatorErrorTypeProvider.class) public void validateSchema(@Summary(value="The schema location") @Path(type=FILE,acceptedFileExtensions="json") String schema, @TypeResolver(value=JsonAnyStaticTypeResolver.class) @Content Object content, @NullSafe @Optional Collection<SchemaRedirect> schemaRedirects, @Optional(defaultValue="CANONICAL") JsonSchemaDereferencingMode dereferencing, @Optional(defaultValue="true") @Placement(tab="Advanced") boolean allowDuplicateKeys, @Optional(defaultValue="false") @Placement(tab="Advanced") @Expression(value=NOT_SUPPORTED) boolean allowArbitraryPrecision)
schema - The location in which the schema to validate against is to be found. This attribute supports URI
representations such as "http://org.mule/schema.json" or "resource:/schema.json". It also supports a most common
classpath reference such as simply "schema.json".content - the json document to be validatedschemaRedirects - Allows to redirect any given URI in the Schema (or even the schema location itself) to any other
specific URI. The most common use case for this feature is to map external namespace URIs without the need to a local
resourcedereferencing - Draft v4 defines two dereferencing modes: canonical and inline. CANONICAL will be the default option but
INLINE can also be specified. When validating a v3 draft this attribute is ignored.allowDuplicateKeys - if true, the validator will allow duplicate keys, otherwise it will fail.allowArbitraryPrecision - if true, the validator will use arbitrary precision when reading floating point values,
otherwise double precision will be used.public void dispose()
dispose in interface org.mule.runtime.api.lifecycle.Disposablepublic void initialise()
throws org.mule.runtime.api.lifecycle.InitialisationException
initialise in interface org.mule.runtime.api.lifecycle.Initialisableorg.mule.runtime.api.lifecycle.InitialisationExceptionCopyright © 2026 MuleSoft, Inc.. All rights reserved.