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

Json binding should use the field local name #389

Closed
tefra opened this issue Jan 20, 2021 · 1 comment · Fixed by #390
Closed

Json binding should use the field local name #389

tefra opened this issue Jan 20, 2021 · 1 comment · Fixed by #390

Comments

@tefra
Copy link
Owner

tefra commented Jan 20, 2021

The parser/serializer always the field definition names instead of the metadata names like their xml counterparts.

tefra added a commit that referenced this issue Jan 20, 2021
@tefra tefra changed the title Json binding use the fields metadata name Json binding should use the field local name Jan 20, 2021
tefra added a commit that referenced this issue Jan 20, 2021
tefra added a commit to tefra/xsdata-w3c-tests that referenced this issue Jan 20, 2021
tefra added a commit to tefra/xsdata-samples that referenced this issue Jan 20, 2021
tefra added a commit to tefra/xsdata-samples that referenced this issue Jan 20, 2021
tefra added a commit to tefra/xsdata-w3c-tests that referenced this issue Jan 20, 2021
@delfick
Copy link

delfick commented Nov 7, 2022

Hello, is it possible to make this optional? I went to upgrade this dependency in a project that relies on the json output having different key names and afaict it's not possible to make it output var.name instead of var.local_name without just copying next_value and changing that yield.

Specifically here, https://github.com/tefra/xsdata/blob/v22.11/xsdata/formats/dataclass/serializers/json.py#L104

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants