Skip to content

SourceFiles.GetFile<T>() fails to deserialize exportOptions due to abstract FileExportOptions type #317

Closed
@XavierDupessey

Description

@XavierDupessey

Hello,

I tried calling crowdinClient.SourceFiles.GetFile using both FileInfoResource and FileResource as the generic type, but neither worked.

The call fails with the following exception:

Newtonsoft.Json.JsonSerializationException: 'Could not create an instance of type Crowdin.Api.SourceFiles.FileExportOptions. Type is an interface or abstract class and cannot be instantiated. Path 'exportOptions.exportPattern', line 19, position 20.'

It seems that the deserialization fails because exportOptions is an abstract type (FileExportOptions) and the SDK doesn't provide concrete implementations or a type discriminator.

Is there something wrong with my usage, or is this a known issue or limitation of the C# SDK?

Thanks in advance!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions