On Wed, Nov 13, 2024 at 08:48:01PM -0500, Paul Spencer wrote: > Chaz, > > I have JSON endpoints in karat 4.4.3 using annotations see > https://lists.apache.org/thread/bfpvpw5kx52vk49kpoo5ztolsh8j2j9f > > Some information that will make it easier to assist: > > 1) What are the versions of > - Karaf > - Swagger > > 2) What entries are you seeing in the karaf log file? > - When you component start. ( I would expect the endpoint and path to be > logged) > - When you make a http request to the end point > - Web related errors > > Per you testing question I do not use Swagger UI, but the REST test in karaf > tests is a place to start. > > https://github.com/apache/karaf/blob/karaf-4.4.6/itests/test/src/test/java/org/apache/karaf/itests/examples/RestExampleTest.java > > Paul Spencer > > > On Nov 13, 2024, at 7:43 PM, apache-karaf-user.pyr3x.com via user > > <user@karaf.apache.org> wrote: > > > > On Tue, Nov 12, 2024 at 11:46:29AM -0500, apache-karaf-user.pyr3x.com via > > user wrote: > >> On Sun, Nov 10, 2024 at 07:05:33AM -0500, apache-karaf-user.pyr3x.com via > >> user wrote: > >>> On Tue, Nov 05, 2024 at 12:07:50PM -0500, apache-karaf-user.pyr3x.com via > >>> user wrote: > >>>> Hello, > >>>> > >>>> I'm running Karaf and have installed the the following features: > >>>> > >>>> 'aries-jax-rs-whiteboard-whiteboard' > >>>> 'aries-jax-rs-whiteboard-openapi' > >>>> > >>>> I have a class with the following annotations: > >>>> > >>>> @Component( > >>>> service = {Blah.class, OpenAPI.class}, > >>>> immediate = true, > >>>> configurationPolicy = ConfigurationPolicy.OPTIONAL) > >>>> @OpenAPIDefinition(info = > >>>> @Info( > >>>> title = "${project.name}", > >>>> version = "${project.version}" > >>>> ) > >>>> ) > >>>> @Path("coolapp") > >>>> @JaxrsResource > >>>> @Consumes(MediaType.APPLICATION_JSON) > >>>> @Produces(MediaType.APPLICATION_JSON) > >>>> @JSONRequired > >>>> @Designate(ocd = Configuration.class) > >>>> @Slf4j > >>>> public class Blah extends OpenAPI { > >>>> > >>>> > >>>> I can access the openapi.yaml at http://localhost:8181/openapi.yaml > >>>> > >>>> How do I make use of the swagger-ui to test my endpoints? > >>>> > >>>> I've tried to install the feature to add it: > >>>> > >>>> 'feature:info cxf-rs-description-openapi-v3' > >>>> > >>>> But can't seem to find the endpoint where it's running (if it is) > >>>> > >>>> Any help would be appreciated! > >>>> > >>>> -- > >>>> Chaz > >>> > >>> ping > >>> > >>> -- > >>> Chaz > >> > >> ping :( > >> > >> -- > >> Chaz > > > > anyone? > > > > -- > > Chaz >
Hi Paul, Yes that first link was me trying to get my REST endpoint deployed. To be clear I am able to deploy just fine and hit all my endpoints with curl. I've also been able to deploy OpenAPI to generate me the openapi.json which describes my endpoints located at http://localhost:8181/openapi.{yaml|json} What I haven't been able to do is deploy the swagger ui which generates the pretty documentation to show the endpoints and allow you to interactively use them for testing based on the generated openapi descriptor. According to https://cxf.apache.org/docs/openapifeature.html I should be fine to access this somewhere. I confirmed that installing the feature 'cxf-rs-description-openapi-v3' takes care of installing Swagger UI. I would expect to be able to go to a url like http://localhost:8181/endpoint?api-url=/openapi.json or similar and see the generated documentation site but I can't seem to get it to work. -- Chaz