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

Macro field disambiguation #351

Closed
untereiner opened this issue Dec 16, 2020 · 3 comments · Fixed by #352
Closed

Macro field disambiguation #351

untereiner opened this issue Dec 16, 2020 · 3 comments · Fixed by #352
Labels
bug Something isn't working

Comments

@untereiner
Copy link

untereiner commented Dec 16, 2020

Hello,

I am trying to convert a set of xml files using xsdata.
In one of these files I have an enum of units of measure.
Two of them end of with the same enum field in python:

  • The field D[API] give D_API
  • The field dAPI gives D_API too

What can I do to avoid that ?
I am thinking xsdata should generate different enum fields for different xml fields

PS: I was looking to gsoap. It generates the unicode of a symbol, for instance __D_x005bAPI_x005d and dAPI

@tefra tefra added the bug Something isn't working label Dec 16, 2020
@tefra
Copy link
Owner

tefra commented Dec 16, 2020

The sanitizer misfires on this case, it is supposed to add an auto-increment suffix for duplicate enum members.

tefra added a commit that referenced this issue Dec 16, 2020
Closes #351
Avoid renaming attrs before jinja filters.
Use text.snake_case to group attributes.
tefra added a commit that referenced this issue Dec 16, 2020
Closes #351
Avoid renaming attrs before jinja filters.
Use text.snake_case to group attributes.
tefra added a commit that referenced this issue Dec 16, 2020
Closes #351
Avoid renaming attrs before jinja filters.
Use text.snake_case to group attributes.
tefra added a commit that referenced this issue Dec 16, 2020
Closes #351
Avoid renaming attrs before jinja filters.
Use text.snake_case to group attributes.
@tefra
Copy link
Owner

tefra commented Dec 16, 2020

Thanks for reporting @untereiner the fix is on master 13fb21f

If you don't like the auto-increment suffixes you can always check the custom aliases in the generator config.

tefra added a commit to tefra/xsdata-samples that referenced this issue Dec 16, 2020
tefra added a commit to tefra/xsdata-w3c-tests that referenced this issue Dec 16, 2020
tefra added a commit to tefra/xsdata-samples that referenced this issue Dec 16, 2020
tefra added a commit to tefra/xsdata-w3c-tests that referenced this issue Dec 16, 2020
tefra added a commit that referenced this issue Dec 17, 2020
Closes #351
Avoid renaming attrs before jinja filters.
Use text.snake_case to group attributes.
@untereiner
Copy link
Author

Thank you @tefra. I will test it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants