Description
Code example
var options = new ClassifyDocumentOptions("my_classifier_id", new Uri("https://myuri.com/"));
var jOptions = new JsonSerializerOptions()
{
Converters = { new JsonModelConverter() }
};
var serial = JsonSerializer.Serialize(options, jOptions);
Behavior
Classifier ID is not present in the serialized string:
{
"urlSource": "https://myuri.com/"
}
Cause
ClassifierId
, as well as properties Split
and Pages
, 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
and DeserializeClassifyDocumentOptions
, 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