User bio
404 bio not found
Member since Apr 27, 2017
Replies:

Hello @Evgeny Shvarov

Unfortunately, when the %JSONFIELDNAME parameter is not explicitly defined, the JSON adaptor treats the property name as a constant, making it fixed and case-sensitive.

However, you can define a custom mapping using an XData block to control how properties are mapped to JSON fields. This provides greater flexibility, and you can even use both %JSONFIELDNAME and XData mappings within the same class.

Example: Custom Mapping with XData

XData OnlyLowercaseTopLevel
{
  <Mapping xmlns="http://www.intersystems.com/jsonmapping">
    <Property Name="Name" FieldName="eventName"/>
    <Property Name="Location" Include="INPUTONLY"/>
  </Mapping>
}
  • Do obj.%JSONImport(dao) Default import (uses standard property names)
  • Do obj.%JSONImport(dao, "OnlyLowercaseTopLevel")Import using a custom mapping
Open Exchange applications:
Certifications & Credly badges:
Ashok Kumar has no Certifications & Credly badges yet.
Global Masters badges:
Followers:
Following: