Skip to content
Discussion options

You must be logged in to vote

Marking a property as optional means that if its value is null, it will be omitted when transforming the object. On the other hand, using a nullable type (?string) ensures the property is always present in the transformed array/JSON, even if its value is null.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@linyuqing222
Comment options

Answer selected by linyuqing222
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants