Search in sources :

Example 1 with SwaggerProxy

use of com.predic8.membrane.core.rules.SwaggerProxy in project service-proxy by membrane.

the class SwaggerRewriterInterceptor method init.

@Override
public void init() throws Exception {
    // inherit wsdl="..." from SoapProxy
    if (this.swagger == null) {
        Rule parent = router.getParentProxy(this);
        if (parent instanceof SwaggerProxy) {
            setSwagger(((SwaggerProxy) parent).getSwagger());
        }
    }
    // use default if no SwaggerProxy is found
    if (this.swagger == null) {
        String swaggerSource = IOUtils.toString(this.getRouter().getResolverMap().resolve(this.swaggerJson));
        this.swagger = new SwaggerParser().parse(swaggerSource);
        this.swaggerUrl = this.swaggerJson;
    }
}
Also used : SwaggerParser(io.swagger.parser.SwaggerParser) SwaggerProxy(com.predic8.membrane.core.rules.SwaggerProxy) Rule(com.predic8.membrane.core.rules.Rule)

Aggregations

Rule (com.predic8.membrane.core.rules.Rule)1 SwaggerProxy (com.predic8.membrane.core.rules.SwaggerProxy)1 SwaggerParser (io.swagger.parser.SwaggerParser)1