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

Support for Multiple Endpoints with the Same @JsonApiX Serial Name #74

Open
myounis97 opened this issue Jan 7, 2025 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@myounis97
Copy link

💡 Feature description

The current implementation of the @JsonApiX annotation generates code with a single serialName value. However, when different endpoints return responses with the same serialName (e.g., "settings"), it results in conflicts during serialization/deserialization. This limitation prevents using the library effectively with APIs where multiple endpoints share the same type but deliver distinct payloads.

ℹ️ Additional information

Example Use Case

  • Endpoint 1 (/a_endpoint):
    { "type": "settings", "aField": "value1" }
  • Endpoint 2 (/b_endpoint):
    { "type": "settings", "bField": "value2" }

With the current library, deserializing these responses into JsonApiX models results in a conflict. By using a namespace or discriminator, the library can differentiate between the two.

🤔 Describe alternatives you've considered

No response

@myounis97 myounis97 added the enhancement New feature or request label Jan 7, 2025
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