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`.
> 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

Reply via email to