SteveDunn / Vogen

A semi-opinionated library which is a source generator and a code analyser. It Source generates Value Objects
Apache License 2.0
734 stars 41 forks source link

The JSON converter class shouldn't be `internal` #613

Closed aradalvand closed 1 month ago

aradalvand commented 1 month ago

Describe the bug

The nested XSystemTextJsonConverter class being internal causes JSON source generation to fail when the value object is in a different assembly; since the generated code wouldn't be able to reference it.

Steps to reproduce

  1. Clone https://github.com/aradalvand/vogen-test
  2. dotnet restore
  3. Open up Program.cs and look at the warning on JsonContext: image
  4. dotnet run --project ./Two
  5. An exception is thrown too.

Expected behaviour

This is likely caused by the fact that the nested converter class has an internal access modifier, and therefore the JSON source generator can't "see" it.

SteveDunn commented 1 month ago

Thanks for the report! This has now been changed and will be in the next release