Skip to content

A rest method with an accessor method name #40

Description

@gabor-farkas

Let's suppose I have a rest endpoint class like:

public class MyService {
  public enum SomeStatus {
    ACTIVE, INACTIVE;
  }
  @GET
  @Path("/status")
  public getSomeStatus() {
    return SomeStatus.ACTIVE;
  }
}

This currently causes:

Caused by: java.lang.NullPointerException
        at java2typescript.jaxrs.ServiceDescriptorGenerator.decorateParamNames(ServiceDescriptorGenerator.java:262)
        at java2typescript.jaxrs.ServiceDescriptorGenerator.generateTypeScript(ServiceDescriptorGenerator.java:161)
        at org.java2typescript.maven.plugin.MainMojo.execute(MainMojo.java:95)

This is because java2typescript.jackson.module.visitors.TSJsonObjectFormatVisitor#isAccessorMethod identifies this as an accessor method.
What would be the best way to solve this? Maybe the isAccessorMethod could look for jax-rs annotations?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions