Fork me on GitHub

@stijn: specifically, the phonebook example uses properties. Essentially properties are your resource's metadata. You tend to grab them from a data source, so you might elect to grab a resource's state too and keep it in the context for the method response function to access. But the resource's state might be large so you might revisit the data source a second time.


yes, I figured it out, it works


I was still using 1.0, so was wondering if it's the same flow / keywords


similar enough 🙂


Query about :parameters. I'm using a schema to validate the body, and it works fine - if there is a body! If I omit the body, no validation. Is this by design or a bug? I would expect an empty body to result in an error, as (s/validate SomeSchema nil) does


One more query: I'm implementing a resource with a POST method:

(yada/resource {
                                 :produces    "application/json"
                                 :methods     {
                                               :post {:consumes "application/json"
                                                      :response {}
Even this minimal definition is returning a 200 status, not 201. Is this right? (I've replaced a function that returns a map with {} to simplify the example - the real function saves a new document to ArangoDB, so I want to return 201 to indicate the resource has been created)


I think it should return a 201 @ijbriscoe


i'm pretty sure it returns 200 at the moment


let me see


It does return 200


Is there a decent workaround for this? The docs talk about yada getting out of your way, but I've stuggled to change the status in the past - is there a good example I can look at? Didn't see one in Edge - then again, I was only looking at the POST method in the Phonebook resource


take a look at 'Explicit responses'


i do think a bug report should be filed for this, though


Tried that - I've probably done something stupid, but ended up with a nasty exception when I tried to set the status in the response