You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2020/01/03 04:43:00 UTC

[jira] [Created] (CAMEL-14352) Add camel-openapi as api-doc discovered component

Claus Ibsen created CAMEL-14352:
-----------------------------------

             Summary: Add camel-openapi as api-doc discovered component
                 Key: CAMEL-14352
                 URL: https://issues.apache.org/jira/browse/CAMEL-14352
             Project: Camel
          Issue Type: Improvement
            Reporter: Claus Ibsen
             Fix For: 3.1.0


In camel-rest we have some code that detects camel-swagger-java. We should add the new camel-openapi component too

        if (apiDoc != null) {
            log.debug("Discovering camel-swagger-java on classpath for using api-doc: {}", apiDoc);
            // lookup on classpath using factory finder to automatic find it (just add camel-swagger-java to classpath etc)
            try {
                FactoryFinder finder = getCamelContext().adapt(ExtendedCamelContext.class).getFactoryFinder(RESOURCE_PATH);
                apiDocFactory = finder.newInstance(DEFAULT_API_COMPONENT_NAME, RestProducerFactory.class).orElse(null);
                parameters.put("apiDoc", apiDoc);
            } catch (NoFactoryAvailableException e) {
                throw new IllegalStateException("Cannot find camel-swagger-java on classpath to use with api-doc: " + apiDoc);
            }
        }




--
This message was sent by Atlassian Jira
(v8.3.4#803005)