can anyone recommend a swagger integration for pedestal? I need to create a rest service with a swagger gui for front end devs.
@macrobartfast are you already using pedestal or do you want to use pedestal for that? (i.e. would the rest service be a fresh project?)
well, I was using luminus, mainly because that's how I had learned to generate a rest backend with swagger... but I didn't actually need the website features of luminus, and I know pedestal is what I should be using for my services (better for microservices, etc)...
but I'm a bit challenged figuring out how to get the swagger ui going in pedestal.
well there's this https://github.com/frankiesardo/route-swagger
but also consider #reitit where swagger is part of the package
it shares a lot of the conceptual ideas with pedetal (interceptors at the very least)
it seems like reitit the popular thing now, so I may as well learn that approach.
so depending on where you are in your project it might be worth considering
and of course, I'm always worried about things with repos that were last updated several years ago... and I know that they may have not been updated because they 'are stable and don't need updating'... but it's always a bit unnerving.
pedestal is doing fine, I use it a lot and would happily pick it again
just thought that because you have that swagger requirement it might be worth mentioning reitit
ah, so #reitit is an alternative to pedestal?
I thought it was going to be part of pedestal or something.
in Clojure stuff you generally shouldn't care about when stuff was updated last, if it works it's kind of going to work "forever" because Clojure is so stable. Literally the most breakage I've seen without code changes has occurred due to changes in the JVM. 😄
I think you can also combine the two but probably easier to just use one
Also reitit is the default thing in the new Luminus so if you're familiar with that might be worth looking there for more info
ah ok... so I'll go with frankiesardo/route-swagger and pedestal to dive into, on your recommendation.
not sure if Luminus has an "API" option that would generate some of that setup code for you
I think I should go with pedestal over luminus in general, if only because it seems like a better thing to learn for enabling microservices to be able to talk to each other.
and that said I guess the luminus reitit would also possibly do that.
it's just hard for folks like me to just get beyond figuring out which frameworks/libraries (I'm not even sure what to call them) to use lol.
yeah that can indeed be a bit tricky in the beginning
lein new luminus myapp +reitit +swagger +service
I think I'd recommend you to take a look at what this generates and see if it fits your need#reitit has first-class support for pedestal, here's a sample (with swagger): https://github.com/metosin/reitit/tree/master/examples/pedestal-swagger
@macrobartfast In short: you swap the default pedestal router into reitit one (with a helper fn) and start using it. Besides swagger, it adds spec & schema coercion, and lot of other things.
@ikitommi That's very cool.
ok... will do!
awesome... trying all this now.
that works perfectly.
I will also learn the other options, for different use cases.