Either at compile time, or at runtime (in a plugin) we should generate a swagger spec for our rest api.

      If we do it in a plugin, it could document the entire rest api of all the plugins installed. This would be nice as we might be able to embed swagger-ui to show a liveish version of the documentation. I imagine this would help front end developers.

          [JENKINS-35808] Autogenerate a swagger spec for rest api

          cliffano added a comment -

          jamesdumay Could you please advise why this issue was resolved as won't fix?

          I'm interested in a Swagger / OpenAPI spec for Jenkins (core would be nice, plugins would be a great bonus).

          cliffano added a comment - jamesdumay Could you please advise why this issue was resolved as won't fix? I'm interested in a Swagger / OpenAPI spec for Jenkins (core would be nice, plugins would be a great bonus).

          James Dumay added a comment -

          The CloudBees members decided that we wouldn't be doing it any time soon so we closed it out. However if you want to contribute it then please reopen

          James Dumay added a comment - The CloudBees members decided that we wouldn't be doing it any time soon so we closed it out. However if you want to contribute it then please reopen

          cliffano added a comment -

          Can't commit to do it right now.
          My interest was on using the spec to generate API libs for various client apps in various langs to use.

          In case others are able to pick this up, do you mind providing some pointers on how you think this could be implemented? (I haven't been monitoring Jenkins core for years)

          cliffano added a comment - Can't commit to do it right now. My interest was on using the spec to generate API libs for various client apps in various langs to use. In case others are able to pick this up, do you mind providing some pointers on how you think this could be implemented? (I haven't been monitoring Jenkins core for years)

          James Dumay added a comment -

          cliffano from what I hear we need our own backend for swagger that understands the structure and model for the REST API. We don't use JAX-B or anything standard (just stapler) so we have to do it ourselves.

          James Dumay added a comment - cliffano from what I hear we need our own backend for swagger that understands the structure and model for the REST API. We don't use JAX-B or anything standard (just stapler) so we have to do it ourselves.

          cliffano added a comment -

          jamesdumay Is blueocean-rest the implementation of the stapler-based REST API? https://github.com/jenkinsci/blueocean-plugin/tree/master/blueocean-rest

          I had a look at Stapler documentation, it doesn't seem that Stapler has a spec a la Swagger / Open API spec. Stapler seems to rely on annotations. I also couldn't find any spec in blueocean-rest module.
          Do I understand this right? Or does Stapler have a spec somewhere in blueocean repo?

          cliffano added a comment - jamesdumay Is blueocean-rest the implementation of the stapler-based REST API? https://github.com/jenkinsci/blueocean-plugin/tree/master/blueocean-rest I had a look at Stapler documentation, it doesn't seem that Stapler has a spec a la Swagger / Open API spec. Stapler seems to rely on annotations. I also couldn't find any spec in blueocean-rest module. Do I understand this right? Or does Stapler have a spec somewhere in blueocean repo?

          cliffano added a comment -

          If anyone is interested. Here's my attempt to generate a Swagger/OpenAPI spec for Jenkins (both Remote Access API and Blue Ocean API) at https://github.com/cliffano/swaggy-jenkins/blob/master/spec/jenkins-api.yml , which I then used to generate lots of API clients https://github.com/cliffano/swaggy-jenkins/tree/master/clients .

          This is obviously still a work in progress and very much an experiment at expanding Jenkins integration reach via multiple language stacks.

          cliffano added a comment - If anyone is interested. Here's my attempt to generate a Swagger/OpenAPI spec for Jenkins (both Remote Access API and Blue Ocean API) at https://github.com/cliffano/swaggy-jenkins/blob/master/spec/jenkins-api.yml  , which I then used to generate lots of API clients https://github.com/cliffano/swaggy-jenkins/tree/master/clients  . This is obviously still a work in progress and very much an experiment at expanding Jenkins integration reach via multiple language stacks.

            Unassigned Unassigned
            jamesdumay James Dumay
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: