JSON Validator

Content Type: Module
Categories: Data

Overview

The JSON Schema Validator is a powerful module tailored for the Mendix platform. Its primary function is to validate JSON data against a specified schema, ensuring consistency and data integrity. This module is fully compliant with the JSON Schema version 2020-12, providing up-to-date validation capabilities.

Documentation

Demo urlhttps://jsonvalidator100-sandbox.mxapps.io/

JSON Schema Validator for Mendix

The JSON Schema Validator is a powerful module tailored for the Mendix platform. Its primary function is to validate JSON data against a specified schema, ensuring consistency and data integrity. This module is fully compliant with the JSON Schema version 2020-12, providing up-to-date validation capabilities.



Steps to Implement the JSON Schema Validator in Your Mendix Application:

Licensing:

  • Before you can utilize the JSON Schema Validator, you need to obtain a license.
  • Contact CAPE via email at support@capegroep.nl to request a license for the module.

Initialization:

  • After obtaining the license, integrate the "AfterStartup" sequence in your existing "AfterStartup" microflow.
  • Ensure you input the license you received from CAPE as a parameter during this integration.

Schema Registration:

  • Utilize the "Register schema" Java action to register your desired JSON schema.
  • This step is vital as it caches the schema, ensuring swift validation in subsequent processes. You only need to do this once, ideally every time your application starts, to maintain the latest version of the schema.

Schema Validation Process:

  • When you need to validate a specific JSON against your registered schema, deploy the "ValidateJSON" microflow.
  • The outcome of this validation is captured in the "ValidationResult" entity.

Validation Outcome:

  • Within the "ValidationResult" entity, inspect the "Result" attribute. If it returns true, it signifies that your JSON data matches the schema and is valid.
  • Conversely, if the JSON data fails validation, you can identify the discrepancies by examining the associated "Error" entity. This entity will provide details about what went wrong during the validation process, enabling you to rectify issues effectively.

Used open source libraries:

  1. fast-json (Apache License version 2) (https://github.com/alibaba/fastjson/blob/master/license.txt)
  2. json-schema (MIT) (https://github.com/harrel56/json-schema/blob/master/LICENSE)
  3. java-jwt (MIT) (https://github.com/auth0/java-jwt/blob/master/LICENSE)
  4. slf4j (MIT) (https://www.slf4j.org/license.html)


Releases

Version: 1.0.0
Framework Version: 9.24.6
Release Notes: Initial Release