Question: Is there a way to generate a ya da server from a swagger definition?

Asked By
Asked At
2018-03-05 16:50:33

Found 15 possible answers.

User Answered At Possible Answer
borkdude 2018-03-05 17:10:15 no
jholkeboer 2018-03-05 19:42:20 How to i tell yada which http status code to return, depending on the request content? Or depending on what error is caught? i tried "declaring" a 400 in my handler, and returning {400 "message}, but it just returned a 200 with {400 "message"} as the body I've been looking at this page:
danielcompton 2018-03-05 21:26:38 @jholkeboer there's different ways depending on how much control you need For you, you probably want to use Schema validation if you can validate the request being bad up front There is a difference between 10.2 Declared responses and 10.3 Status responses, but I can't remember what they are So if you would have got a 404 for a particular request, you can override the 404 response with your own response entry A status response is used for overriding Yada's default responses for a particular status code Explicit responses let you return the full response from the context (assoc (:response ctx) :status 418) There are three ways to return a response, explicit responses, declared responses, and status responses I had to read this a few times to really get it, I would like to make a PR to explain it better e.g. if a form request doesn't pass the Schema then it will return a 400 without you having to do anything If you follow the happy path of yada, then you never need to explicitly set status codes as it will do it all for you, based on it's understanding of the HTTP spec
mmer 2018-03-06 11:39:14 Is there any tools that generate a clojure server from swagger spec?
nha 2018-03-06 12:02:18 not that I know of
jmckitrick 2018-03-07 21:33:39 Hi all. I just cloned yada and I’m following the directions for the demo: CompilerException java.lang.RuntimeException: Invalid token:, compiling:(yada/dev/web_server.clj:29:61) Concluding with: Reflection warning.... And I’m getting errors: (dev)
SLACK 2018-03-07 21:37:44 [juxt/yada] Pull request submitted: " #221 Fix broken namespaced keyword" by danielcompton
danielcompton 2018-03-07 21:37:50 @jmckitrick Just made a PR to fix it I think that that syntax worked at one point in time, I remember Cider had a similar issue at one point
jmckitrick 2018-03-07 21:44:10 Hmm, ok. I’ll try that locally… Any advocacy I can take back to my team? :wink: So we got Clojure in the door at our Scala shop, and we’re going to start with some microservices. I’m considering yada and compojure-api, among others….
danielcompton 2018-03-07 21:57:50 I'd recommend starting with juxt/edge That's a pretty good template to hit the ground running with
SLACK 2018-03-08 10:36:51 [juxt/yada] Issue created: " #222 Setting Content-Type to x results in 500 internal server error with NullPointerException" by borkdude [juxt/yada] Pull request submitted: " #223 Allow schemas to be passed to ring-swagger" by tanzoniteblack
matttylr 2018-03-14 11:23:06 Morning
malcolmsparks 2018-03-14 11:23:23 Hi
matttylr 2018-03-14 11:23:35 Hi @malcolmsparks , just the man :slightly_smiling_face: but my vhost config seems correct, it’s like yada isn’t able to pick up the HOST or HOSTNAME env var
> from my yada deployment
getting a 
Not found
malcolmsparks 2018-03-14 11:24:36 Vhosts not matching Sorry, taking off Doesn't use HOST yada looks at the request and x-forwarded-proto header

Related Questions