You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the functionality that isn't covered by this suite.
I would like to utilize source generation in System.Text.Json for some POCOs that rely on types from this package, such as JsonPointer. However, it appears that the source generator consistently includes the custom JsonPointerJsonConverter, which is internal and is applied to the JsonPointer class, leading to a build failure.
The issue can be reproduced with the following code:
// Build error: 'JsonPointerJsonConverter' is inaccessible due to its protection levelpublicrecordErrorResponse(stringCode,stringMessage,JsonPointer?Target);[JsonSerializable(typeof(ErrorResponse))]publicpartialclassErrorResponseContext:JsonSerializerContext{}
Describe alternatives you've considered.
Would it be possible for you to consider changing the visibility of the custom JSON converters to public?
Is there any other information you'd like to share regarding this functionality?
No response
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
I don't know a lot about the interaction between JSON source gen and the standard converters. My understanding was that they were different systems, but it seems the source gen uses converters if they're defined.
I don't see a problem with exposing them. I didn't originally because it wasn't necessary. (And I didn't want to write XML comments for more than I had to 😆.)
Describe the functionality that isn't covered by this suite.
I would like to utilize source generation in
System.Text.Json
for some POCOs that rely on types from this package, such asJsonPointer
. However, it appears that the source generator consistently includes the custom JsonPointerJsonConverter, which isinternal
and is applied to theJsonPointer
class, leading to a build failure.The issue can be reproduced with the following code:
Describe alternatives you've considered.
Would it be possible for you to consider changing the visibility of the custom JSON converters to
public
?Is there any other information you'd like to share regarding this functionality?
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: