data-api-builder icon indicating copy to clipboard operation
data-api-builder copied to clipboard

Fix the Serialization/Deserialization issue with $ prefix columns

Open Alekhya-Polavarapu opened this issue 2 months ago • 0 comments

Why make this change?

Serialization and deserialization of metadata currently fail when column names are prefixed with the $ symbol.

Root cause

This issue occurs because we’ve enabled the ReferenceHandler flag in our System.Text.Json serialization settings. When this flag is active, the serializer treats $ as a reserved character used for special metadata (e.g., $id, $ref). As a result, any property name starting with $ is interpreted as metadata and cannot be deserialized properly.

What is this change?

This update introduces custom logic in the converter’s Write and Read methods to handle $-prefixed column names safely.

  • During serialization, columns beginning with $ are escaped as "_$".

  • During deserialization, this transformation is reversed to restore the original property names.

How was this tested

  • [x] Unit tests

Alekhya-Polavarapu avatar Oct 31 '25 18:10 Alekhya-Polavarapu