Skip to content

Conversation

@championswimmer
Copy link

This is to handle the case, where some server side serialization libraries might mixup singular and plural type names.

An example are these two nodejs libraries

https://www.npmjs.com/package/jsonapi-serializer - produces plurals
https://www.npmjs.com/package/json-api-serializer - produces singulars

We can now support multiple types

@Type({"comments", "comment"})
public class Comment {
	@Id
	private String id;
	private String body;
	// ...
}

Signed-off-by: Arnav Gupta [email protected]

Signed-off-by: Arnav Gupta <[email protected]>
@championswimmer
Copy link
Author

@aggarwalpulkit596

@championswimmer championswimmer changed the title allow alternate typenames allow alternate typenames and relationships Jan 4, 2020
@championswimmer
Copy link
Author

Hey @jasminb could you take a look at this please :)

Thanks

@jasminb
Copy link
Owner

jasminb commented Mar 4, 2021

@championswimmer This looks like a useful improvements, however instead of changing the Type annotation to an array and breaking things for all of the users, I would rather add another attribute to the annotation, eg. alternativeNames which could than be used by people who need it and all existing users don't need to change anything.

@championswimmer
Copy link
Author

@championswimmer This looks like a useful improvements, however instead of changing the Type annotation to an array and breaking things for all of the users, I would rather add another attribute to the annotation, eg. alternativeNames which could than be used by people who need it and all existing users don't need to change anything.

Well, ok that makes a lot more sense !

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.

3 participants