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

Wrong definition when method name does not match XmlElement.name #1510

Open
troosan opened this issue Jul 10, 2023 · 1 comment
Open

Wrong definition when method name does not match XmlElement.name #1510

troosan opened this issue Jul 10, 2023 · 1 comment

Comments

@troosan
Copy link

troosan commented Jul 10, 2023

When the name defined in the XmlElement annotation does not match the method name, the generated openapi is wrong

image

it then returns
image

Issue can be reproduced with https://github.com/troosan/quarkus-jaxb-openapi-reproducer

@troosan
Copy link
Author

troosan commented Jul 10, 2023

here is a sample class

package test.io.smallrye.openapi.runtime.scanner.dataobject.javax;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

@XmlAccessorType(value = XmlAccessType.NONE)
@XmlType(name = "TypeName", propOrder = { "field1", "field2" })
public class XmlAccessTypeMembersWithNoneAccessorType {

    @XmlElement(name = "field2")
    public String prop1Field;

    public String prop2Field;

    @XmlElement(name = "field1")
    public String getProp3Property() {
        return null;
    }

}

The test should verify that

  • The name of the type is TypeName
  • Only field1 and field2 are returned (with proper type)
  • The order of the elements is respected

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

No branches or pull requests

1 participant