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

Allow stateful converters #15

Open
plilja opened this issue Jul 18, 2020 · 0 comments
Open

Allow stateful converters #15

plilja opened this issue Jul 18, 2020 · 0 comments

Comments

@plilja
Copy link

plilja commented Jul 18, 2020

Say for instance that you change your API by replacing a nested type with a reference. Then in your "pastConverter" you would probably need a database lookup. That would be easier to achieve if the converters could be stateful instead of being created new each time, like they are now.

Example:
Say your API contains a Person type:

Person {
   socialSecurityNumber [String],
   firstName [String],
   lastName [String],
   address: [Address]
}

and you remove the address field and replace it with addressId. Then to be backwards compatible you would need to lookup the address from your database.

It looks like it could be achieved by allowing the VersioningModule-class to accept a list of converter instances or some kind of ConverterRepository.

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

1 participant