typescript-generator icon indicating copy to clipboard operation
typescript-generator copied to clipboard

Some interfaces are not generated

Open pieterdegraeuwe opened this issue 1 year ago • 0 comments

I am trying to generate typescript interfaces starting from my restEasy JaxB resources.

Interfaces for the classes seems to be generated fine.

However, my java classes do contain an 'IdRef', which is typed with Java generics to the Rest Resource where that object can be fetched.

example:


@XmlRootElement(name = "testdto", namespace = "http://www.someorg.be/testapp/rest")
public class TestDTO extends TestAbstractDTO<PdgTestResource> {
    private String name;
    //getters and setters omitted
}

public class TestAbstractDTO<T> {
    private IdRef<T> idRef;
    //getters and setters omitted
}

My resource interface:

@Path(TestResource.PATH_RESOURCE)
public interface TestResource {
    String APPLICATION_VND_SOMEORG_TEST_JSON = "application/vnd.someorg.test.beknopt+json";
    String PATH_RESOURCE = "/testpath";

    @GET
    @Path("/")
    @Produces({APPLICATION_VND_SOMEORG_TEST_JSON})
    List<TestDTO> all();

    @GET
    @Path("/{id}")
    @Produces({APPLICATION_VND_SOMEORG_TEST_JSON})
    TestDTO loadBeknoptById(@PathParam("id") Long id, @QueryParam(PARAM_TAAL) Long taalId);
}

As said, the interface for TestDTO is generated perfectly, along with all other iterfaces that are used in super classes. But, the resource interface itself, is not being genrated, as seen in the generated TypeScript below:

The interface TestResource is used in the Interface TestDTO, but is not being generated.

/* tslint:disable */
/* eslint-disable */
// Generated using typescript-generator version 3.0.1157 on 2022-11-09 09:12:14.

export interface TestDTO extends TestAbstractDTO<TestResource> {
    idRef: IdRef<TestResource>;
    name: string;
}

export interface IdRef<T> extends MetLongId, Serializable, MetUniqueIdentifier {
    identifier: number;
    uid: string;
    uri: URI;
    version: number;
}

//other interfaces omitted for clarity

Any hints how I can work-around this?

pieterdegraeuwe avatar Nov 09 '22 08:11 pieterdegraeuwe