Skip to content
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

Nullable when EmitDefaultValue is False #84

Merged

Conversation

digocesar
Copy link
Collaborator

Option to validate C# EmitDefaultValue into DataMember attribute.

If EmitDefaultValue is false, then the TypeScript property is Nullable.

In example, C# source:

public class A
{
    [DataMember(EmitDefaultValue = false)]
    public bool Prop1 { get; set; }

    public bool Prop2 { get; set; }
}

Will be converted to TypeScript:

export interface A {
    Prop1?: boolean
    Prop2: boolean
}

Rodrigo Cesar and others added 2 commits July 18, 2024 16:22
If TRUE, set property as optional when WCF attribute DataMember.EmitDefaultValue is False.
@digocesar digocesar merged commit 345d7a8 into svenheden:master Jan 27, 2025
3 checks passed
@digocesar
Copy link
Collaborator Author

Hi @svenheden, can you release version 1.2.0?

@digocesar digocesar deleted the optional-when-ommit-default-value branch January 27, 2025 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant