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 field names with periods
Matthew Rasmussen
If I have a JSON schema that includes periods in field names, the periods get parsed into structural components of the output JSON. For instance this:
"MSH": {
"MSH.1": "|",
"MSH.2": "^~\&",
...parses as this in translation:
"MSH":{
"MSH":{
"1":"\\|",
"2":"^~\\&",
Is there a way to specify literal periods in the field names, without them getting parsed as structural components?
Find more posts tagged with
Clovertech
Comments
Jim Kosloskey
I am not a JSON expert and have done little work with JSON.
However a little reading on the web indicates periods (dots) in JSON field names may be representative of a structure and thus not allowed to actually be part of a field name - which is what I think you are seeing via the Xlate.
The recommendation I saw was to use underscore in place of the period (dot).
If this is a Schema you built then I would try to replace the periods in field names with underscore.
If someone else built this schema, then I would try to validate it in one of the free online JSON Schema validation tools. If one or more of the tools indicate an issue with the period (dot), I would present that evidence to the originator of the schema and suggest they send a corrected schema.
Matthew Rasmussen
Hi Jim,
Funny story - I actually rebuilt the schema yesterday exactly as you suggested, with the underscores - great minds... I'll have to get the vendor's blessing, but we're redesigning the API in question anyway, so it shouldn't be too hard to sell. Especially if I take your additional advise and prove that these names don't observe JSON best practice. You can't blame Cloverleaf for following the rules to the letter. I appreciate you sharing your wisdom and advise!