osgi-jax-rs-connector icon indicating copy to clipboard operation
osgi-jax-rs-connector copied to clipboard

swagger.basePath is not listed in swagger.json

Open madhugarimilla opened this issue 8 years ago • 1 comments

I am trying to add the basepath to swagger.json so that it gets listed as part of the json and can be used in swagger ui to try out the apis. I have been using the below code inside my Activator class, but the basePath is not listed as part of the swagger.json

ServiceReference<?> reference = context.getServiceReference( ConfigurationAdmin.class.getName() ); ConfigurationAdmin configAdmin = ( ConfigurationAdmin )context.getService( reference ); Configuration configuration = configAdmin.getConfiguration( "com.eclipsesource.jaxrs.swagger.config", null ); Dictionary<String, Object> properties = new Hashtable<String, Object>(); properties.put( "swagger.basePath", "/rest/v1" ); configuration.update( properties ); context.ungetService( reference );

madhugarimilla avatar Feb 23 '17 16:02 madhugarimilla

Well, in my case using the OSGi config admin to configure swagger does not work at all, not only for swagger.basePath but also for all other properties listed in: https://github.com/hstaudacher/osgi-jax-rs-connector/wiki/Swagger-Integration#configuration The resulting swagger.json does not change at all by updating the configuration.

ghareeb-falazi avatar Dec 21 '17 16:12 ghareeb-falazi