citrusframework / citrus

Framework for automated integration tests with focus on messaging integration
https://citrusframework.org
Apache License 2.0
445 stars 135 forks source link

fix: validate json array order if strict mode #1155

Closed novarx closed 1 month ago

novarx commented 1 month ago

See #1157 A follow up to https://github.com/citrusframework/citrus/pull/1102 It seems that not validating the order of json arrays if strict is not the desired behaviour.

see https://github.com/citrusframework/citrus/pull/1102#discussion_r1458473481

novarx commented 1 month ago

@bbortt

etieskrill commented 1 month ago

I think there is the need to configure the json array ordering separately from the strict mode. This should be configurable on a per-test basis. Probably by adding a new field to org.citrusframework.validation.json.JsonMessageValidationContext, something like checkArrayOrder, and choosing the validation method for array items based off of the new property, instead of strict. If the property was not set explicitly, the default should be false if non-strict, and true if strict, i think.