Skip to content
This repository was archived by the owner on Mar 5, 2024. It is now read-only.
This repository was archived by the owner on Mar 5, 2024. It is now read-only.

Using SDK and Deserialization Exceptions #107

Open
@davidyardy

Description

@davidyardy

I am follow code sample on https://github.com/Autodesk-Forge/forge-api-dotnet-client/blob/master/docs/DerivativesApi.md#getmetadata

  try
            {
                Metadata result = apiInstance.GetMetadata(urn, acceptEncoding);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling DerivativesApi.GetMetadata: " + e.Message );
            }

I am getting exception about unable to convert to Metadata (deserilization).

It looks like I need to modify to this to avoid this error/exception.

          Autodesk.Forge.Model.DynamicJsonResponse result = await apiInstance.GetMetadataAsync(urn, acceptEncoding);
           Metadata m = result.ToObject<Metadata>();

Now I can get the Metadata result. Can you confirm this is correct?

Metadata

Metadata

Assignees

No one assigned

    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