Skip to content

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

Open
@myounis97

Description

@myounis97

💡 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions