-
Notifications
You must be signed in to change notification settings - Fork 2k
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
GenerateSerializer should be compatible with the required keyword. #8367
Comments
We will need to fix this ASAP. Thank you for reporting it, @jamescarter-le. For now, as a workaround, I can think of a couple of options:
|
I just dropped required for now as the least friction option.
Thank you.
…On Tue, Apr 4, 2023, 16:28 Reuben Bond ***@***.***> wrote:
We will need to fix this ASAP. Thank you for reporting it, @jamescarter-le
<https://github.com/jamescarter-le>.
I think the only viable fix is to avoid using new for types which have
required properties, even if they have an accessible zero-parameter
constructor.
For now, as a workaround, I can think of a couple of options:
- Do not use required
- Add the [UseActivator] attribute to your types which have required
properties.
- Avoid having an accessible (public or internal) zero-parameter
constructor
—
Reply to this email directly, view it on GitHub
<#8367 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMRJLCIDXKCSSKDFFDGFW3W7Q4Y7ANCNFSM6AAAAAAWSU2VNA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Any update on this? |
I am looking into this now. For types with |
Fix PR opened: #8595. Thank you for bumping the issue |
Currently the compiler throws an error when trying to use the
required
keyword withGenerateSerializer
Gives error:
Required member 'Foo.Bar' must be set in the object initializer or attribute constructor.
The text was updated successfully, but these errors were encountered: