Hi Okay I have it almost working in the sprindoc UI. However there is a glitch when using servlet as you need to have the servlet run in its own context-path so it does not affect spring-boot, eg that is why it runs with /camel/* by default. However the UI when you click "try it out" then it invokes the service without that content-path.
So I need to find a solution for this in rest-dsl + servlet + open-api - however if I invoke the correct url then it works nice. There is also some tags that just say "camel" we can maybe enrich this by default to have a bit more nicer details like the Actuator does. The work is pushed on a branch here https://github.com/apache/camel-spring-boot/tree/CAMEL-17061 On Sun, Oct 10, 2021 at 12:28 PM Claus Ibsen <[email protected]> wrote: > > Hi > > Yeah that is a good idea. However as springdoc is for spring boot > only, then lets put it only into camel-spring-boot project. > > camel-springdoc-starter > > I have some prototype code I put into camel-openapi-java that can be > moved into this new springdoc-starter and used as a starting point. > Then you should be able to just add camel-springdoc-starter JAR as > dependency to your project and then it comes with the UI included. > > I will put my work into a branch on camel-spring-boot upstream, then > you are welcome to look at that and work on the > camel-springdoc-starter. > Documentation should be included in the > src/main/docs/springdoc-starter.adoc file. > > > > > > > > On Sat, Oct 9, 2021 at 6:16 PM Steve973 <[email protected]> wrote: > > > > That sounds great! I was able to get both definitions to coexist, although > > I am not sure if it is entirely ideal or not. I achieved this in the > > configuration: > > > > springdoc: > > show-actuator: true > > swagger-ui: > > disable-swagger-default-url: true > > urls: > > # Definition generated by springdoc for the actuator endpoints > > - url: /v3/api-docs > > name: Spring Boot Actuator > > # The Camel REST DSL swagger > > - url: /api/api-doc > > name: Rest API > > > > Now, if we change the selection at the top, where it says "Select a > > definition", we can choose between the REST API and the Spring Boot > > Actuator endpoints. > > > > I do like your idea, though. If we can have these things work together, > > and more easily, that would be even better. Should I attempt to create a > > camel-springdoc-java component and starter? I can see this working well > > with the REST DSL, and with other spring boot rest controllers all > > coexisting in the same project. In the forums, etc, I saw more than a > > couple of questions about getting a UI on top of swagger, so this might be > > a useful thing for some people. > > > > On Sat, Oct 9, 2021 at 11:57 AM Claus Ibsen <[email protected]> wrote: > > > > > Hi Steven > > > > > > Thanks for the work. I looked as well and we can likely make Camel > > > automatic enlist its rest-dsl into spring boot so the springdoc can > > > automatic discover it > > > https://issues.apache.org/jira/browse/CAMEL-17061 > > > > > > We do this in the -starter JARs and make it possible to turn on|off so > > > users can decide. > > > > > > > > > On Sat, Oct 9, 2021 at 5:23 PM Steve973 <[email protected]> wrote: > > > > > > > > Please have a look at my working example. When I get it all working, > > > > and > > > > cleaned up, I can submit it as one of the camel example modules, if that > > > > would be helpful. I would make the project resemble the other examples > > > as > > > > closely as possible. I thought that being able to include the actuator > > > > endpoints would be a good illustration of how other REST endpoints could > > > be > > > > included with the camel rest information. > > > > > > > > On Sat, Oct 9, 2021 at 10:59 AM Steve973 <[email protected]> wrote: > > > > > > > > > Thank you, Claus. I have been chipping away at this problem, and it > > > > > is > > > > > quite possible to point springdoc to the generated swagger JSON. In > > > > > my > > > > > application.yml: > > > > > > > > > > springdoc: > > > > > show-actuator: true > > > > > swagger-ui: > > > > > disable-swagger-default-url: true > > > > > url: /api/api-doc > > > > > > > > > > You can see that I have "show-actuator: true", but I have not gotten > > > this > > > > > to work, yet. I don't suppose that there is any way to have the camel > > > > > openapi java component include this in its openapi doc generation, is > > > there? > > > > > > > > > > On Sat, Oct 9, 2021 at 10:11 AM Claus Ibsen <[email protected]> > > > wrote: > > > > > > > > > >> Hi > > > > >> > > > > >> At first thought I would assume springdoc needs a way to discover the > > > > >> Camel Rest DSL model (api doc). > > > > >> And maybe this can be done by exposing a bean into Spring that is of > > > > >> type OpenApi > > > > >> > > > > >> @Bean > > > > >> public OpenApi camelRestDsl() { > > > > >> ... // some code here that gathers the camel rest-dsl model and > > > > >> return as bean > > > > >> } > > > > >> > > > > >> However I am only speculating. > > > > >> > > > > >> You can try to add a custom method in your sample app and just > > > > >> hardcode some bogus open api model as above and see if springdoc > > > > >> detects this. > > > > >> > > > > >> Otherwise it can help if you have time to read into springodc how to > > > > >> integrate with custom frameworks. > > > > >> > > > > >> > > > > >> > > > > >> On Sat, Oct 9, 2021 at 1:37 PM Steve973 <[email protected]> wrote: > > > > >> > > > > > >> > Hi, Claus. Thank you for the reply! You can find springdoc here: > > > > >> > https://springdoc.org/ and I moved my project from using springfox > > > > >> because > > > > >> > springfox has only one developer, and springdoc is maintained by a > > > > >> > community. The artifact that I am using is > > > > >> > "org.springdoc:springdoc-openapi-ui:1.5.11". I am using Spring > > > > >> > Boot > > > > >> 2.5.5, > > > > >> > and Camel 3.12.0. So that you can also see what I am doing, in > > > case I > > > > >> am > > > > >> > doing something that is prohibiting the Camel OpenAPI functionality > > > from > > > > >> > working correctly, I pushed my example to Github: > > > > >> > https://github.com/Steve973/spring-camel-rest-experiments where I > > > am > > > > >> trying > > > > >> > out a minimal example just to see if I can get it working. Thanks > > > > >> again! > > > > >> > > > > > >> > Steve > > > > >> > > > > > >> > On Sat, Oct 9, 2021 at 3:23 AM Claus Ibsen <[email protected]> > > > > >> wrote: > > > > >> > > > > > >> > > Hi > > > > >> > > > > > > >> > > I have not tried that myself, can you maybe point links to where > > > this > > > > >> > > spring ui exists? > > > > >> > > And what version of SB and Camel are you using? > > > > >> > > > > > > >> > > > > > > >> > > On Sat, Oct 9, 2021 at 12:37 AM Steve973 <[email protected]> > > > wrote: > > > > >> > > > > > > > >> > > > Hello. I am using spring boot with the camel rest dsl and it > > > > >> > > > is > > > > >> working > > > > >> > > > great. I can also have swagger JSON generated and accessible. > > > But > > > > >> I > > > > >> > > would > > > > >> > > > like to use the springdoc openapi user interface to interact > > > with > > > > >> my rest > > > > >> > > > endpoints. I have tried for hours, and I have not been able to > > > get > > > > >> the > > > > >> > > UI > > > > >> > > > to come up. Does anyone know if it is possible to use > > > camel-rest > > > > >> and the > > > > >> > > > springdoc openapi user interface together? > > > > >> > > > > > > >> > > > > > > >> > > > > > > >> > > -- > > > > >> > > Claus Ibsen > > > > >> > > ----------------- > > > > >> > > http://davsclaus.com @davsclaus > > > > >> > > Camel in Action 2: https://www.manning.com/ibsen2 > > > > >> > > > > > > >> > > > > >> > > > > >> > > > > >> -- > > > > >> Claus Ibsen > > > > >> ----------------- > > > > >> http://davsclaus.com @davsclaus > > > > >> Camel in Action 2: https://www.manning.com/ibsen2 > > > > >> > > > > > > > > > > > > > > > > > -- > > > Claus Ibsen > > > ----------------- > > > http://davsclaus.com @davsclaus > > > Camel in Action 2: https://www.manning.com/ibsen2 > > > > > > > -- > Claus Ibsen > ----------------- > http://davsclaus.com @davsclaus > Camel in Action 2: https://www.manning.com/ibsen2 -- Claus Ibsen ----------------- http://davsclaus.com @davsclaus Camel in Action 2: https://www.manning.com/ibsen2
