[BUG] Serialization of customized models missing properties #47612
Labels
bug
This issue requires a change to an existing behavior in the product in order to be resolved.
Client
This issue points to a problem in the data-plane of the library.
Cognitive - Form Recognizer
Code example
Behavior
Classifier ID is not present in the serialized string:
Cause
ClassifierId
, as well as propertiesSplit
andPages
, were added in the custom code layer and not part of the output of our code generator. For this reason, the generated logic for serializing/deserializing this model does not take into account these custom properties.Solution
We must write custom code for methods
JsonModelWriteCore
andDeserializeClassifyDocumentOptions
, which are responsible for serializing and deserializing this model, respectively. However, during serialization we must be careful to not duplicate these extra properties when sending a REST request to the Document Intelligence service.Affected models
Any models with additional custom properties could be affected by this bug. These are the models that are likely to be affected:
AnalyzeBatchDocumentsOptions
AnalyzeDocumentOptions
ClassifyDocumentOptions
The following models have custom properties but may not be affected given the nature of the custom code:
AnalyzedDocument
BuildDocumentModelOptions
ClassifierDocumentTypeDetails
DocumentField
The text was updated successfully, but these errors were encountered: