compojure-api icon indicating copy to clipboard operation
compojure-api copied to clipboard

OpenAPI?

Open luposlip opened this issue 4 years ago • 5 comments

Library Version(s)

[metosin/compojure-api "2.0.0-alpha31"]
[metosin/spec-tools "0.10.4"]

Problem

I can't seem to find a standard way to generate OpenAPI specification from my api. I have the swagger spec and swagger UI working just fine (and it rocks!). But a team I'm working with needs OpenAPI specs (and possibly also UI).

It'd be cool if the :swagger etc. could be replaced by :openapi in this snippet of a snippet:

(api
   {:swagger
    {:ui "/"
     :spec "/swagger.json"
     :data {...

Do you have an example project where you've implemented this, or can you give me some hints on how - if possible - to achieve this?

Thanks.

luposlip avatar Oct 05 '20 18:10 luposlip

Anyone? :wink:

luposlip avatar Dec 13 '20 17:12 luposlip

How to upvote this request? +1:

aphsa avatar Dec 28 '20 06:12 aphsa

Hello, if it's still relevant I've created an example project with generation OpenAPI3 documentation with compojure-api here. It was very quick and needs some cleanup, file uploads don't work so far (I'm going to fix it).

I'd like to open PR to this repo to add OpenAPI3 docs generation out of the box, but I need to figure out how to do it better way. Probably support of swagger2 generation should be dropped in this case.

rrudakov avatar Feb 25 '21 10:02 rrudakov

Really cool, thanks so far @rrudakov !

luposlip avatar Feb 25 '21 13:02 luposlip

@luposlip I've fixed file uploads in my example.

rrudakov avatar Feb 25 '21 14:02 rrudakov