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

Service fetch automatically changes snake_case to camelCase #5089

Open
LaurensBurger opened this issue Feb 6, 2025 · 1 comment · May be fixed by #5096
Open

Service fetch automatically changes snake_case to camelCase #5089

LaurensBurger opened this issue Feb 6, 2025 · 1 comment · May be fixed by #5096
Assignees
Labels
needs-backport Fix must be backported to stable release branch owner: den-haag

Comments

@LaurensBurger
Copy link
Collaborator

LaurensBurger commented Feb 6, 2025

Product versie / Product version

3.0.2

Customer reference

DH

Omschrijf het probleem / Describe the bug

Example HTTP query string with a "data_attrs" key:

{"type": ["https://objecttypen.nl/api/v2/objecttypes/23fb3e3e-c313-4be0-b8ed-51cdc5e31449"], "data_attrs": ["training__naam__exact__{{keuzeTraining}},training__status__exact__OPEN_VOOR_INSCHRIJVINGEN"]}

turns into "dataAttrs":

Image

Which breaks the service fetch, until the form builder manually changes the camelCase back to snake_case.

This causes double actions to be performed after each migration of a form: first set the right service, then change the key's to whatever they need to be.

(It is also believed these changes get reverted in some scenario's and break the service fetch, because it's using "dataAttrs" again)

Verwacht gedrag / Expected behavior

The config that exists in the service fetch should not "change" under any circumstance.

Screen resolution

None

Device

None

OS

None

Browser

No response

@LaurensBurger LaurensBurger added the triage Issue needs to be validated. Remove this label if the issue considered valid. label Feb 6, 2025
@joeribekker
Copy link
Contributor

Refinement: DRF camelcase might be the problem, maybe replace or work around (with a mechanism that is already there)?
Estimate: a day

@joeribekker joeribekker added owner: den-haag and removed triage Issue needs to be validated. Remove this label if the issue considered valid. labels Feb 10, 2025
@joeribekker joeribekker added the needs-backport Fix must be backported to stable release branch label Feb 10, 2025
@robinmolen robinmolen moved this from Todo to In Progress in Development Feb 10, 2025
robinmolen added a commit that referenced this issue Feb 10, 2025
When using an existing service fetch config, that uses snake_case for the `query_params` or `body`, the `query_params` and `body` are turned to camelCase
robinmolen added a commit that referenced this issue Feb 10, 2025
Make sure that `body` and `query_params` on service fetch configuration keep their original case type
@robinmolen robinmolen linked a pull request Feb 10, 2025 that will close this issue
10 tasks
@robinmolen robinmolen linked a pull request Feb 10, 2025 that will close this issue
10 tasks
@robinmolen robinmolen moved this from In Progress to Implemented in Development Feb 10, 2025
robinmolen added a commit that referenced this issue Feb 18, 2025
When using an existing service fetch config, that uses snake_case for the `query_params` or `body`, the `query_params` and `body` are turned to camelCase
robinmolen added a commit that referenced this issue Feb 18, 2025
Make sure that `body` and `query_params` on service fetch configuration keep their original case type
robinmolen added a commit that referenced this issue Feb 18, 2025
When using an existing service fetch config, that uses snake_case for the `query_params` or `body`, the `query_params` and `body` are turned to camelCase
robinmolen added a commit that referenced this issue Feb 18, 2025
Make sure that `body` and `query_params` on service fetch configuration keep their original case type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-backport Fix must be backported to stable release branch owner: den-haag
Projects
Status: Implemented
Development

Successfully merging a pull request may close this issue.

3 participants