JSON Validation?

JSON Validation?

Comments

  • [font=Calibri, sans-serif]Does Decisions do input JSON validation? Can this be enabled/disabled on a case-by-case basis?[/font]

  • [font=Roboto, Arial, Helvetica, sans-serif]If the JSON sent to a flow via POST is malformed, the flow itself will not notice it. There is a system default rule named Test JSON Is Valid that can validate JSON text, however. If the input of a flow is found to be invalid with this rule, its false path can have a Throw API Exception step send a response code and some specified error message - e.g. 400: invalid JSON: asdf. (FlowWithJSONValidation)[/font]
    [font=Roboto, Arial, Helvetica, sans-serif]
    [/font]
    [font=Roboto, Arial, Helvetica, sans-serif]If you want to validate some inputs [i]but not all[/i], you can [/font]achieve this by adding steps to check on the values of all other fields in a JSON input except those that do not need to be validated. (ADifferentApproachToJSONValidation)

    I have attached two example flows for these cases.

Sign In or Register to comment.