osgi-jax-rs-connector
osgi-jax-rs-connector copied to clipboard
swagger.basePath is not listed in swagger.json
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 );
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.