-
Notifications
You must be signed in to change notification settings - Fork 299
Fix serialization for StoredProcedureDefinition inheritance #3045
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…/Azure/data-api-builder into alpolava/fix_dollarSerialization
There was a problem hiding this 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.
src/Core/Services/MetadataProviders/Converters/DatabaseObjectConverter.cs
Show resolved
Hide resolved
src/Core/Services/MetadataProviders/Converters/DatabaseObjectConverter.cs
Outdated
Show resolved
Hide resolved
Aniruddh25
left a comment
There was a problem hiding this 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.
|
/azp run |
|
Azure Pipelines successfully started running 6 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 6 pipeline(s). |
Why make this change?
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?