morphic-bio / data-ingestion-development

Repository to track the internal issues regarding DRACC development and operations
0 stars 0 forks source link

Include 'id' Field in JSON Response Body #72

Open KociOrges opened 3 months ago

KociOrges commented 3 months ago

Implement a feature to include the id field in the JSON response body for the Provider API. This alias should ensure compatibility with certain API clients, such as Marcin's UI, avoiding manual parsing of URL paths in HAL links. Additionally, a potential enhancement could be to activate this alias based on the active profile, specifically for the morphic profile.

KociOrges commented 3 months ago

Solution: created an alias jsonIdAlias annotated with @JsonProperty("id") for the id field in the AbstractEntityClass while keeping the actual id field hidden from JSON serialization using @JsonIgnore. The branch for this implementation is here: https://github.com/ebi-ait/ingest-core/tree/feature/morphic-include-id-in-response-body