Hi Mikhail, for Swagger support in Camel we use swagger-parser[1] which transparently supports loading both JSON and YAML. I would encourage you to try the OpenAPI support we have, that uses apicurio-data-models[2] which I find to be much more reliable and easier to use. You also get OpenAPI 3 support with it.
zoran [1] https://github.com/swagger-api/swagger-parser [2] https://github.com/Apicurio/apicurio-data-models On Tue, Mar 24, 2020 at 2:58 PM Mikhail Lukyanov <lukyanov...@gmail.com> wrote: > > Thank you, Zoran. I understand auth doesn't need in this case. > > Can you answer another question? > > Is rest-swagger component supports only JSON swagger spec and doesn't > support YAML? > > пн, 23 мар. 2020 г. в 13:57, Zoran Regvart <zo...@regvart.com>: > > > Hi Mikhail, > > I must say that that's a very strange requirement. Authentication is > > just one of the ways this would fail; it could also fail if the > > service hosting the OpenAPI document is unavailable. I'd approach this > > problem differently by downloading the OpenAPI document and bundling > > it within the Camel application. > > > > zoran > > > > On Fri, Mar 20, 2020 at 9:27 AM Mikhail Lukyanov <lukyanov...@gmail.com> > > wrote: > > > > > > Hello, everyone > > > > > > Is it possible to somehow get the swagger specification by a HTTP request > > > from a resource that requires authorization? Now when I start the route I > > > get an error > > > > > > Caused by: org.apache.camel.FailedToCreateProducerException: Failed to > > > create Producer for endpoint: rest-swagger:// > > > > > http://192.168.58.241:8181/manager/v2/api-docs%23getUsingGET?componentName=http-swagger > > . > > > Reason: java.lang.IllegalArgumentException: The given Swagger > > specification > > > could not be loaded from ` > > http://192.168.58.241:8181/manager/v2/api-docs` > > <http://192.168.58.241:8181/manager/v2/api-docs>. > > > Tried loading using Camel's resource resolution and using Swagger's own > > > resource resolution. Swagger tends to swallow exceptions while parsing, > > try > > > specifying Java system property `debugParser` (e.g. > > `-DdebugParser=true`), > > > the exception that occured when loading using Camel's resource loader > > > follows at > > > org.apache.camel.impl.ProducerCache.doGetProducer(ProducerCache.java:578) > > > at > > > > > org.apache.camel.impl.ProducerCache.acquireProducer(ProducerCache.java:168) > > > > > > > > > > > > I thought I can set header with auth in the rout, by the rout didn't > > start > > > > > > Camel version 2.20.2 > > > > > > > > > > > > -- > > > *With best regards, Lukyanov Mikhail* > > > *Tel: **+7-909-69-71-547* > > > > > > > > -- > > Zoran Regvart > > > > > -- > *With best regards, Lukyanov Mikhail* > *Tel: **+7-909-69-71-547* -- Zoran Regvart