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

Apply JSON to existing object using JsonProperty or other descriptors #16

Open
veraw opened this issue Aug 7, 2020 · 3 comments
Open

Comments

@veraw
Copy link

veraw commented Aug 7, 2020

NodeJS

Is there a way to use jackson-js to apply either a JSON string or an already transformed JSON plain javascript object to an existing object (typescript class) so that JSON properties are applied (copied / set) based on the @JsonProperty (or other descriptors within jackson-js)? (eg: ObjectMapper.apply(targetObject, "{ name: 'John', age: 45 }") ) where output "targetObject" then has all fields / properties with jackson-js descriptors values applied. (Apply should incorporate views and other jackson-js logic)

@dailytabs
Copy link

Was looking for this exact solution. I already have an object created by the time my API call is sent, when it comes back, I'd like to simply populate the existing object (which already has multiple properties assigned and the object has been registered in a manager service, so it's locked down). Options for overwriting existing values, validating against existing values, or excluding already set values would be nice, too.

@veraw
Copy link
Author

veraw commented Oct 21, 2022

Been a while, so closing

@vladraduvidican
Copy link

Did you find a solution?

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

No branches or pull requests

3 participants