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

System.Text.Json default contract resolvers fail early on misconfigured attributes #71966

Open
Tracked by #71967
eiriktsarpalis opened this issue Jul 11, 2022 · 1 comment
Labels
area-System.Text.Json enhancement Product code improvement that does NOT require public API changes/additions
Milestone

Comments

@eiriktsarpalis
Copy link
Member

The default System.Text.Json contract resolvers will fail early if they encounter misconfigured attributes such as the following:

  • Properties with conflicting names (possible via the JsonPropertyNameAttribute).
  • Invalid type arguments in JsonConverterAttribute.
  • JsonExtensionDataAttribute applied to unsupported property types or duplicate JsonExtensionDataAttribute properties.

Misconfigured attributes in third-party libraries are a real problem and as such one of the goals for contract customization is for users to be able to manually correct misconfigured attributes. In the future we should update our validation logic so that it happens post-configuration, where feasible.

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Jul 11, 2022
@ghost
Copy link

ghost commented Jul 11, 2022

Tagging subscribers to this area: @dotnet/area-system-text-json, @gregsdennis
See info in area-owners.md if you want to be subscribed.

Issue Details

The default System.Text.Json contract resolvers will fail early if they encounter misconfigured attributes such as the following:

  • Properties with conflicting names (possible via the JsonPropertyNameAttribute).
  • Invalid type arguments in JsonConverterAttribute.
  • JsonExtensionDataAttribute applied to unsupported property types or duplicate JsonExtensionDataAttribute properties.

Misconfigured attributes in third-party libraries are a real problem and as such one of the goals for contract customization is for users to be able to manually correct misconfigured attributes. In the future we should update our validation logic so that it happens post-configuration, where feasible.

Author: eiriktsarpalis
Assignees: -
Labels:

area-System.Text.Json

Milestone: -

@eiriktsarpalis eiriktsarpalis removed the untriaged New issue has not been triaged by the area owner label Jul 11, 2022
@eiriktsarpalis eiriktsarpalis added this to the 8.0.0 milestone Jul 11, 2022
@eiriktsarpalis eiriktsarpalis added the enhancement Product code improvement that does NOT require public API changes/additions label Jul 11, 2022
@krwq krwq modified the milestones: 8.0.0, Future Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Text.Json enhancement Product code improvement that does NOT require public API changes/additions
Projects
None yet
Development

No branches or pull requests

2 participants