RWS / dxa-content-management

SDL Digital Experience Accelerator CM-side framework (.NET Template Building Blocks)
Apache License 2.0
6 stars 18 forks source link

Empty embedded schema field value can result in empty string in model JSON #19

Closed willprice76 closed 5 years ago

willprice76 commented 6 years ago

We have schemas which use a common Standard Metadata embedded schema for metadata field values. If there is no content in this embedded field, then the published entity model JSON has, instead of no, or null value an empty string value. This then causes errors in the model mapping in the (Java) web application, as it tries to map a string value to an object.

rpannekoek commented 5 years ago

The transformation from XML to DXA R2 JSON is intentionally done without loading/compiling the CM Schema (for performance reasons). So, it may not be possible to distinguish an embedded field without contents (empty XML element) from a text field without contents (empty XML element).

However, the semantic mapping should of course be able to deal with this scenario.

rpannekoek commented 5 years ago

Internal Issue ID (for tracking purposes): CRQ-12801

rpannekoek commented 5 years ago

This has been fixed in https://github.com/sdl/dxa-content-management/releases/tag/DXA_2.2.1_Hotfix