Skip to content

Conversation

@Alekhya-Polavarapu
Copy link
Contributor

@Alekhya-Polavarapu Alekhya-Polavarapu commented Jan 7, 2026

Why make this change?

  • To apply correct serialization and deserialization logic for stored procedures. With the previous changes, serialization was not working correctly for the StoredProcedureDefinition type, which extends SourceDefinition. When the value type was passed explicitly for serialization, the parent type was used instead, causing some child-type properties to be omitted.

What is this change?

Instead of manually specifying the value type during serialization, this change allows the library to infer the type automatically and perform the correct serialization.

How was this tested?

  • Unit Tests

Copilot AI review requested due to automatic review settings January 7, 2026 23:01
@Alekhya-Polavarapu Alekhya-Polavarapu changed the title Dev/alpolava/fix serialization Fix serialization for StoredProcedureDefinition inheritance Jan 7, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request fixes a serialization issue where StoredProcedureDefinition objects (and other derived types of SourceDefinition) were being serialized as their base type, causing child-specific properties like Parameters to be omitted from the serialized output.

Key Changes:

  • Modified serialization to use runtime type inference instead of explicit property type
  • Updated property type checking to include derived types of SourceDefinition
  • Enhanced tests to validate serialization of dollar-prefixed column names in dictionary context

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/Core/Services/MetadataProviders/Converters/DatabaseObjectConverter.cs Updated Write method to use runtime type for serialization instead of declared property type; modified IsSourceDefinitionProperty to recognize derived types using IsAssignableFrom
src/Service.Tests/UnitTests/SerializationDeserializationTests.cs Refactored three test methods to serialize objects within Dictionary wrappers (matching real-world usage) and added assertions to verify dollar-prefixed columns are properly escaped

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Collaborator

@Aniruddh25 Aniruddh25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with some suggestions to rename.

@Aniruddh25
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 6 pipeline(s).

@Alekhya-Polavarapu
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 6 pipeline(s).

@Alekhya-Polavarapu Alekhya-Polavarapu enabled auto-merge (squash) January 12, 2026 18:55
@Alekhya-Polavarapu
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 6 pipeline(s).

@Alekhya-Polavarapu Alekhya-Polavarapu merged commit 090e68e into main Jan 13, 2026
11 checks passed
@Alekhya-Polavarapu Alekhya-Polavarapu deleted the dev/alpolava/fixSerialization branch January 13, 2026 17:41
Alekhya-Polavarapu added a commit that referenced this pull request Jan 13, 2026
## Why make this change?
- To apply correct serialization and deserialization logic for stored
procedures. With the previous changes, serialization was not working
correctly for the StoredProcedureDefinition type, which extends
SourceDefinition. When the value type was passed explicitly for
serialization, the parent type was used instead, causing some child-type
properties to be omitted.
## What is this change?
Instead of manually specifying the value type during serialization, this
change allows the library to infer the type automatically and perform
the correct serialization.

## How was this tested?
- [x] Unit Tests

---------

Co-authored-by: Aniruddh Munde <anmunde@microsoft.com>
Alekhya-Polavarapu added a commit that referenced this pull request Jan 15, 2026
)

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

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.

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.

- [x] Unit tests

---------

Co-authored-by: Aniruddh Munde <anmunde@microsoft.com>

Fix serialization for StoredProcedureDefinition inheritance (#3045)

- To apply correct serialization and deserialization logic for stored
procedures. With the previous changes, serialization was not working
correctly for the StoredProcedureDefinition type, which extends
SourceDefinition. When the value type was passed explicitly for
serialization, the parent type was used instead, causing some child-type
properties to be omitted.
Instead of manually specifying the value type during serialization, this
change allows the library to infer the type automatically and perform
the correct serialization.

- [x] Unit Tests

---------

Co-authored-by: Aniruddh Munde <anmunde@microsoft.com>

Update src/Core/Services/MetadataProviders/Converters/DatabaseObjectConverter.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Fix documentation typos in serialization comments (#3057)

Code review identified typos in XML documentation comments that
inaccurately described the escaping mechanism and contained spelling
errors.

Fixed documentation comments to accurately reflect the implementation:

- **DatabaseObjectConverter.cs**: Updated escape/unescape method
summaries to correctly describe the `DAB_ESCAPE$` prefix transformation
(previously incorrectly documented as `_$`)
- **SerializationDeserializationTests.cs**: Corrected "deserilization" →
"deserialization" in three test method comments

- [x] Documentation-only change, no functional changes

<!-- START COPILOT CODING AGENT TIPS -->
---

💬 We'd love your input! Share your thoughts on Copilot coding agent in
our [2 minute survey](https://gh.io/copilot-coding-agent-survey).

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Alekhya-Polavarapu <67075378+Alekhya-Polavarapu@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants