You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Change TypeName in DatabaseObject Serialization to exclude unwanted parts (#2154)
## What is this change?
Change TypeName in DatabaseObjectConverter during DatabaseObject
Serialization to exclude the unwanted parts.
Currently TypeName field added during DatabaseObject serialization is
set to Type.AssemblyQualifiedName, which looks like :
"Azure.DataApiBuilder.Config.DatabasePrimitives.DatabaseTable,
Azure.DataApiBuilder.Config, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null"
1.0.0.0 was the default value set, hence when the version changes,
deserialization will fail if the initial serialization had version as
1.0.0.0.
Updating this TypeName to only include the necessary parts :
"Azure.DataApiBuilder.Config.DatabasePrimitives.DatabaseTable,
Azure.DataApiBuilder.Config"
Tested again by using Type.FullName which is
"Azure.DataApiBuilder.Config.DatabasePrimitives.DatabaseTable", but
serialization fails saying DatabaseTable not found.
## Why make this change?
Due to recent changes to update the version number based of release,
deserialization on graphql workload failed, it is looking for version
1.0.0.0 which doesnot exists. Hence removing the dependency on version
number.
## How was this tested?
- Unit Tests
/// During serialization we add TypeName to the DatabaseObject based on its type. TypeName is the AssemblyQualifiedName for the type.
339
-
/// Example : "TypeName": "Azure.DataApiBuilder.Config.DatabasePrimitives.DatabaseTable, Azure.DataApiBuilder.Config, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null",
339
+
/// Example : "TypeName": "Azure.DataApiBuilder.Config.DatabasePrimitives.DatabaseTable, Azure.DataApiBuilder.Config",
340
340
/// If there is a code refactor which changes the path of this object, the deserialization with old value will fail, as it wont be able to find the object in the location
341
341
/// previously defined.
342
342
/// Note : Currently this is being used by GraphQL workload, failure of this test case needs to be
0 commit comments