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

Update TypeHelper.IsLiteralType to avoid catching LanguageConstants.Object #8952

Merged
merged 2 commits into from
Nov 7, 2022

Conversation

jeskew
Copy link
Contributor

@jeskew jeskew commented Nov 7, 2022

A more comprehensive fix is included in #8949, but this should resolve #8950 and adds some tests to prevent a regression.

Microsoft Reviewers: Open in CodeFlow

@jeskew jeskew requested a review from a team November 7, 2022 19:36
Comment on lines +91 to +92
ObjectType objectType => (objectType.AdditionalPropertiesType is null || objectType.AdditionalPropertiesFlags.HasFlag(TypePropertyFlags.FallbackProperty)) &&
objectType.Properties.All(kvp => kvp.Value.Flags.HasFlag(TypePropertyFlags.Required) && IsLiteralType(kvp.Value.TypeReference.Type)),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind adding a comment explaining this condition?

Copy link
Member

@anthony-c-martin anthony-c-martin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this!

@jeskew jeskew enabled auto-merge (squash) November 7, 2022 19:54
@jeskew jeskew merged commit 41892bd into main Nov 7, 2022
@jeskew jeskew deleted the jeskew/8950 branch November 7, 2022 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot add @allowed values for parameter of type object
2 participants