infor.com
concierge
infor u
developer portal
documentation central
customer center
Posts
Categories
Groups
ERPs
CSD
FSM/HRT
LN
M3
Syteline/ CSI
Hubs
Developer
Healthcare
Hospitality
Public Sector
Onboarding
Release Center
CloudSuites
Aerospace & Defense (LN)
Automotive (LN)
Chemicals (M3)
Corporate (FSM/HRT)
Distribution (Sx.e/CSD)
Distribution Enterprise (M3)
Engineering & Construction (LN)
Fashion (M3)
Food & Beverage (M3)
Healthcare (FSM/HRT)
Industrial (Syteline/CSI)
Industrial Enterprise (LN)
Manufacturing (M3)
Public Sector (FSM/HRT)
Solutions
Supply Chain Management (SCM)
Human Capital Management (HCM)
Events
Groups
User Groups
Your Groups
About
Email Community Support
Infor News
Migrated Forums
Home
Clovertech
Clovertech Archive
Cloverleaf
JSON Minimum Maximum Items validation
David Burgess
I've been working with the JSON configurator and I'm trying to enforce minimum and maximum items for arrays. I've turned on the root level validation, and successfully tested the "Required" option, but minimum and maximum don't seem to have any effect that I can tell. I'm using Cloverleaf 19.1 in an RHEL environment. Should a violation of the min/max items in the configurator flag a validation error, or I'm I misunderstanding what a violation of the min/max items for arrays does?
Thanks
Find more posts tagged with
Clovertech
Comments
Jim Kosloskey
I have not done JSON but maybe it is just like HL/7 variant lengths in that it simply truncates if the max is reached with no error.
Perhaps for the Minimum it places a single space or null value when the minimum is not present.
An interesting question.
David Burgess
Thanks Jim! I should test that for field definitions. In this case I'm working with number of items in an array. (For example I want to enforce that the Insurance array has a minimum of one instance, but not more than three instances.) I can of course manipulate that myself, but if the function exists in the tool, I'd love to use it to reject messages that fail validation as they come in the door.
Jim Kosloskey
Well the X12 variant had max repetitions for some repeating items but I don't recall if it actually did anything.
It will be interesting to find out - keep us updated.
David Burgess
Quick update on this issue. The GUI allows you to only enter integer values for "min" and "max", but under the hood the program expects something like "2.0" instead of "2". If you manually edit the JSON schema and insert the ".0", it works fine. Beware that if you later open the schema in the GUI the tool will remove the ".0" and any save will revert to back to non-working integers. Infor has registered this as a problem and will work to work a fix into a future release/patch.