web stats
Mirth Community - View Single Post - json schema parsing for jsonrpc messages
View Single Post
Old 05-20-2017, 06:18 AM
sBham sBham is offline
Mirth Newb
Join Date: Feb 2017
Posts: 6
sBham is on a distinguished road
Default json schema parsing for jsonrpc messages

Hey there,

I was wondering what the community would recomment for efficiently validating json messages that I was provided json schema for. (it seems like json schema is almost like the usual equivalent in XML world).

In this case the implementation is both http and channel listners and the goal is to validate the json payload at the source filters using either: filter steps, a custom java jar that would expose a json schema parsing method to validate a message against its corresponding scheam. Or some type of javascript library at the transformation?

In this case we are talking about close to 100 different message contracts/format I was given (and same for response). So implemeting filters for each field might be a daunting task especially if I was given the json schema for each request and response. there are libraries out there that would validate a json document against a json schema (just like we have in XML world)

In either java or node.js I would have used one of the json schema libraries available (http://json-schema.org/implementations#validator-java). However before I start validation work, I would like to query the community and support for what would be the recommended most efficient ways or alternative solutions.

Format/schema of request json payload:

{"method": "methodName",
"id": "arbitrary-something",
"params": [arg1, arg2, ...]}

Format/schema of response json payload:

{"result": the_result,
"error": null,
"id": "arbitrary-something"}

Mirth connect 3.5 (and final solution to be ultimately deployed on an appliance)

Reply With Quote