JAX-RS and swagger extension

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

JAX-RS and swagger extension

Laurent Rustuel-4

Hello,

I’m trying to have two jax-rs application and swagger specification.

I tried something like :

 

JaxRsApplication jaxRsApplication = new JaxRsApplication(restletComponent.getContext().createChildContext());

//    jaxRsApplication.getJaxRsRestlet().addClass(CustomExceptionMapper.class);

 

 

 

    jaxRsApplication.add(helloApplication);

    jaxRsApplication.add(echoApplication);

 

    JaxRsApplicationSwaggerSpecificationRestlet jaxRsApplicationSwaggerSpecificationRestlet =

      new JaxRsApplicationSwaggerSpecificationRestlet(echoApplication);

 

    restletComponent.getServers().add(Protocol.HTTP, port);

 

    // access to docs on all url

//    restletComponent.getDefaultHost().attach(jaxRsApplicationSwaggerSpecificationRestlet);

//    restletComponent.getDefaultHost().attach(jaxRsApplication);

//

//    challengeAuthenticator.setVerifier(myVerifier);

//    challengeAuthenticator.setNext(jaxRsApplicationSwaggerSpecificationRestlet);

 

 

    // access to resources but no api doc

//    restletComponent.getDefaultHost().attach(jaxRsApplication);

//    restletComponent.getDefaultHost().attach(jaxRsApplicationSwaggerSpecificationRestlet);

//

//    challengeAuthenticator.setVerifier(myVerifier);

//    challengeAuthenticator.setNext(jaxRsApplicationSwaggerSpecificationRestlet);

 

 

    // access to docs on all url

    restletComponent.getDefaultHost().attach(jaxRsApplicationSwaggerSpecificationRestlet);

    restletComponent.getDefaultHost().attach(jaxRsApplication);

 

    challengeAuthenticator.setVerifier(myVerifier);

    challengeAuthenticator.setNext(jaxRsApplication);

 

    restletComponent.getDefaultHost().attach(challengeAuthenticator);

    restletComponent.start();

 

I can’t have access to my resources and api doc generated at the same time. Anyone can share with me how to correctly setup this ?

 

Thanks in advance

 

(test project can be found https://github.com/gartcimore/swaggerjaxrstest)

--
You received this message because you are subscribed to the Google Groups "Restlet Framework (Discuss)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
Loading...