[Feature request] Nullable properties in generated code #327
-
Howdy, I am trying to generate a class based on E.g. I like to represent a Thank you |
Beta Was this translation helpful? Give feedback.
Answered by
dstelljes
Dec 5, 2024
Replies: 2 comments
-
You can use the dotnet avro generate --nullable-references <<EOF
{
"type": "record",
"name": "Example",
"fields": [
{
"name": "Nullable",
"type": ["null", "string"]
}
]
}
EOF public class Example
{
public string? Nullable { get; set; }
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
petrkoutnycz
-
Crap, you are right. I apologize, did not notice that. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use the
--nullable-references
flag (https://engineering.chrobinson.com/dotnet-avro/cli/generate/#options):