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

protected setter/getter is in the generated typescript #2587

Open
jcgueriaud1 opened this issue Jun 28, 2024 · 0 comments
Open

protected setter/getter is in the generated typescript #2587

jcgueriaud1 opened this issue Jun 28, 2024 · 0 comments
Labels
bug Something isn't working hilla Issues related to Hilla

Comments

@jcgueriaud1
Copy link

Describe the bug

When I have this Java class:


public class Person {

    @NotNull
    private String fullName = "fullName";

    @NotNull
    private String descriptionPublic = "descriptionPublic";
    @NotNull
    private String descriptionProtected = "descriptionProtected";

    public String getFullName() {
        return fullName;
    }

    public void setFullName(String fullName) {
        this.fullName = fullName;
    }

    protected String getDescriptionProtected() {
        return descriptionPublic;
    }

    protected void setDescriptionProtected(String descriptionProtected) {
        this.descriptionProtected = descriptionProtected;
    }

    public String getDescriptionPublic() {
        return descriptionPublic;
    }
}

The model generated in Typescript is containing descriptionProtected:

interface Person {
    fullName?: string;
    descriptionPublic?: string;
    descriptionProtected?: string;
}
export default Person;

The data sent doesn't contain the descriptionProtected

Expected-behavior

The model should be:

interface Person {
    fullName?: string;
    descriptionPublic?: string;
}
export default Person;

Note: If you remove the Setter then the model doesn't contain descriptionProtected.

Reproduction

https://github.com/jcgueriaud1/hilla-example-form/tree/bug-protected

Go to the home page and see the data in the copilot log (the data is ok).

Go to the Person.ts and see the descriptionProtected

System Info

Vaadin 24.4.4

@jcgueriaud1 jcgueriaud1 added bug Something isn't working hilla Issues related to Hilla labels Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hilla Issues related to Hilla
Projects
None yet
Development

No branches or pull requests

1 participant