Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Client bug]: InnerError uses wrong case to serialize/deserialize date field #2262

Closed
olivermue opened this issue Dec 20, 2023 · 1 comment · Fixed by microsoftgraph/msgraph-metadata#539

Comments

@olivermue
Copy link

Describe the bug
When Graph returns an error it contains an Error and an InnerError. This InnerError has a date field when the error happened. This field is within the SDK marked as Date, but it must be date. Otherwise the field won't be populated and must be read from the AdditionalData dictionary.

        public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers() {
            return new Dictionary<string, Action<IParseNode>> {
                {"client-request-id", n => { ClientRequestId = n.GetStringValue(); } },
                {"Date", n => { Date = n.GetDateTimeOffsetValue(); } }, // 👈🏻 wrong case
                {"@odata.type", n => { OdataType = n.GetStringValue(); } },
                {"request-id", n => { RequestId = n.GetStringValue(); } },
            };
        }
        public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers() {
            return new Dictionary<string, Action<IParseNode>> {
                {"client-request-id", n => { ClientRequestId = n.GetStringValue(); } },
                {"date", n => { Date = n.GetDateTimeOffsetValue(); } }, // 👈🏻 correct case
                {"@odata.type", n => { OdataType = n.GetStringValue(); } },
                {"request-id", n => { RequestId = n.GetStringValue(); } },
            };
        }

https://github.com/microsoftgraph/msgraph-sdk-dotnet/blob/d0ed65c90cd5fd5fd22fe8b3ea4e420036e2f1b1/src/Microsoft.Graph/Generated/Models/ODataErrors/InnerError.cs#L85C21-L85C21

@andrueastman
Copy link
Member

Thanks for raising this @olivermue .

This is a metadata issue that should be resolved via #2262

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants