-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
Issue while generating bindings #659
Comments
Hey @lucabotti can you provide the schema please or a sample? |
Attaching the whole tree. |
Here is the issue
The gender code type is clearly an enumeration and the base class is not. Jaxb translates that to @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "GenderCodeType")
public class GenderCodeType
extends CodeType
{
} Which practically eliminates the enumeration, I am not so sure if this is the correct way, do you have any xml samples that go with that suite? |
I thought this scenario was not allowed or something, since none of my 25k samples have it. The easiest approach would be to mimick xjc but I am not so sure that's correct either, that's why I would like some xml samples to see if there is a better alternative. |
Hi, Pyxbgen (old, I know) managed the enumeration with the attached file. I have same examples of Agreement I attach. |
Notes: Ideally we would create a new enumeration with the target members, copy the value node from the base class and set the type to this new enumeration. Unfortunately mypy don't like that. This fixes #659 for now but I want to experiment some on this one, with literals.
Notes: Ideally we would create a new enumeration with the target members, copy the value node from the base class and set the type to this new enumeration. Unfortunately mypy don't like that. This fixes #659 for now but I want to experiment some on this one, with literals.
Hey @lucabotti thanks for reporting this issue, interesting suite, I added it in the samples. A fix is on master, it's not really what I wanted but it follows jaxb practise. The issue is about restricting complex/simple content types with specific enumeration values. Ideally I wanted to be able to something like this, but mypy doesn't allow for that. class Foo:
value: str
class Bar(Foo):
value : SomeEnumeration
class SomeEnumeration(Enum):
A = 1
B = 2 So for now the end result will be like this, I will try to find a solution to somehow keep the enumeration values either as python class Foo:
value: str
class Bar(Foo):
pass |
I opened a new issue to follow up with a proper, if possible, solution in the future #663 |
HI Tefra, thanks. Will check everything. |
While generating bindings with the following command:
xsdata generate -r xsd --package generali.service-models
I receive the following error
xsdata.exceptions.CodeGenerationError: Enumeration class with a complex extension.
JAXB (Java API) manages the xsd , and I submitted the same to w3c org validator. Any way to get more details about the error?
The text was updated successfully, but these errors were encountered: