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

Create flag that allows only one-way conversion (serialization or deserialization) #204

Open
andreas-aeschlimann opened this issue Apr 22, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@andreas-aeschlimann
Copy link
Member

It would be nice if there was a flag for a property that decides whether it should only be serialized or deserialized.

For example, you could have

    @JsonProperty("a", Number)
    a: number = 0;

    @JsonProperty("a", Number)
    b: number = 0;

Now you want deserialize the JSON property a to both class properties a and b, but when serializing you only want to use the class property a.

As of now, in that case there is a collision and b will override a.

@andreas-aeschlimann andreas-aeschlimann added the enhancement New feature or request label Apr 22, 2024
@andreas-aeschlimann andreas-aeschlimann self-assigned this Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant