This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-11-15
Channels
- # aleph (24)
- # announcements (8)
- # babashka (27)
- # beginners (55)
- # biff (4)
- # calva (32)
- # cider (5)
- # clj-kondo (11)
- # clojure (59)
- # clojure-android (3)
- # clojure-australia (1)
- # clojure-belgium (6)
- # clojure-dev (21)
- # clojure-europe (26)
- # clojure-nl (1)
- # clojure-norway (17)
- # clojurescript (19)
- # css (1)
- # data-science (10)
- # datahike (17)
- # events (3)
- # figwheel-main (4)
- # honeysql (1)
- # hugsql (5)
- # hyperfiddle (1)
- # jobs (1)
- # leiningen (3)
- # lsp (6)
- # malli (5)
- # meander (4)
- # nbb (6)
- # off-topic (87)
- # pathom (19)
- # portal (2)
- # re-frame (4)
- # reitit (6)
- # releases (1)
- # remote-jobs (3)
- # shadow-cljs (29)
- # sql (8)
- # tools-deps (6)
- # xtdb (7)
I'm trying to generate swagger docs for an endpoint. The request payload seems to be wrong though. More info in ๐งต
This is what the endpoint looks like:
["/foo/:resource/zoo"
{:post {:handler resource.zoo/get-resource-zoo
:parameters {:body ::resource.zoo/body}}
:name :resource.zoo/get}]
and this is what the generated swagger docs look like:
{
"metric": "string",
"dimensions": {
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
},
"date-range": {
"to": "string",
"from": "string"
}
}
1. This json shows up in the swagger ui under a single parameter called body. Expected behaviour: Each of the keys should be a separate body parameter.
2. The swagger json that reitit generates has "body"
nested under "parameters"
. Expected behaviour: It should be under "requestBody"
, next to "parameters"
I'm not sure if I've made a mistake or if it's a bug or something, so I'd appreciate some help, thanks!
edit: the stack is pedestal + reitit + specOn closer inspection, requestBody
seems to be an OpenAPI 3.0 feature which reitit doesn't support yet ๐
ฮ can see there's an https://github.com/metosin/reitit/pull/563 that adds support for OpenAPI 3.0. The last activity was ~2 months ago but I'd love to have this in master, so are there any plans to merge it, or even reasons not to? ๐
If you think the PR is ready, you can just get the files and save them to your src/. Of course in your classpath src/ has to be closer to the front.
Thanks for the suggestion but if someone from metosin plans to take a look at the PR, I'd much rather stay on OpenAPI 2 for a while and wait to get proper support than try to hack it together. It's obviously ok if the metosin team is too busy right now, I'm only asking to manage my expectations before I decide what to do with the problem (e.g. stay on OpenAPI 2.0, write yaml, fork reitit, etc).
ฮ can see there's an https://github.com/metosin/reitit/pull/563 that adds support for OpenAPI 3.0. The last activity was ~2 months ago but I'd love to have this in master, so are there any plans to merge it, or even reasons not to? ๐