更新时间:2023-11-29 13:47:04
我做了一个小样本来演示json验证程序的工作原理.您可以使用相同的
i did a small sample to demonstrate how json validator works. you can use the same
这是一些针对我的流程使用不同json输入的响应
here are some of the responses with different json inputs against my flow
您始终可以根据自己的需要来增强架构.您可以为每个键定义数据类型.假设key3应该只包含数字值,key2应该是一个数组.诸如此类的任何事情都可以通过修改架构来实现,验证器将相应地验证传入的json.
you can always enhance your schema to suite your needs. you can define data type for each key. lets say key3 should contain only numeric values, key2 should be an array. anything like that all can be achieved by modifying your schema and the validator will validate the incoming json accordingly.
更新: 这是the子流的xml内容
update: here is the xml content of the mule flow
<flow name="***Flow1" doc:id="c24d34aa-ce1d-4bbb-b3fd-d73007dad60b" >
<http:listener doc:name="Listener" doc:id="80ab5db5-1d3e-409f-9990-cebf1fc07dd5" config-ref="HTTP_Listener_config" path="/valid"/>
<json:validate-schema doc:name="Validate schema" doc:id="0a51cde0-5175-4f11-b972-3d5d708094c6" schema="schema.json"/>
<logger level="INFO" doc:name="Logger" doc:id="2d95a6f0-8f88-4608-bdb8-7fae8abc0e6d" message="valid json"/>
</flow>