OpenFeign / OpenFeign/feign

Expand POJO in URL params to multiple object params

Open
#2,018 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feedback provided question
Dominant language
Java
Stars
9.8k
Forks
1.9k
Avg merge
1d 2h
Merged PRs (30d)
41

Description

Hi!
I think I might need some help here.

Lets say, I have this API contract GET /api/v1/game with url params - gameId, token, settings[language,currency]
In my case, I need the final URL to be like this: /api/v1/game?gameId=1&token=2&settings[language]=en&settings[currency]=USD

I have proper DTO with required fields including 'Settings' object. So for this scenario the temporary solution was using @Param("settings[language]") and so on, but then I should get rid of Settings field.
Is there a more proper way to expand an POJO field to multiple URL params in the style I mentioned before?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating Feign's handling of @Param values and DTO fields used for URL parameters. Verify how the Settings object is currently represented, then define whether the requested bracketed language and currency parameters can be generated while retaining the DTO field; done means the API contract produces the four shown query parameters without separate annotations for each nested value.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.