Skip to content

Process JAX-RS annotations on interfaces #1427

@fritzrichter

Description

@fritzrichter

In our project, we have jax-rs (jersey) interfaces and implementations. As the interfaces are shared, I do not want to put any annotation to the actual interfaces which are not jax-rs specific. I added swagger annoations like @Api or @apioperation on the impl and let the jax-rs specific stuff like @path, @PathParam etc. on the interface.

@Bean
    public BeanConfig getConfig() {

        BeanConfig config = new BeanConfig();
        config.setVersion(apiVersion);
        config.setSchemes(swaggerSchemes);
        config.setResourcePackage("com.ads.userservice.client,com.ads.userservice.api");
        config.setHost(swaggerHost);
        config.setBasePath(swaggerBasePath);
        config.setScan(true);
         ReflectiveJaxrsScanner scanner = new ReflectiveJaxrsScanner();
        scanner.setResourcePackage("com.adsquare.userservice.client,com.adsquare.userservice.api");
        ScannerFactory.setScanner(scanner);

        return config;
    }

I tried different things, including the ReflectiveJaxrsScanner, but nothing worked out.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions