Fork me on GitHub
#ring-swagger2015-08-12
>
ulsa11:08:53

Can't find documentation or tests in compojure-api describing :headers in :responses. Just a vector of strings or keywords, perhaps? What should be expected if response has or hasn't the headers?

juhoteperi11:08:56

@ulsa: :headers works just like :body, it takes binding symbol and schema

juhoteperi11:08:00

:responses should map of status code to map containing keys :body and optionally :description

ulsa11:08:03

:body? docs say :schema, :description and :headers. would like an example

ulsa11:08:15

Am I looking at the correct docs? "Key :responses takes a map of http-status-code to schema-definitions map (with optional :schema, :description and :headers keys)." Says nothing of what :headers should look like. No examples, no tests.

juhoteperi11:08:54

:headers [headers {:header-a s/Str :header-b s/Keyword}]

juhoteperi11:08:36

or I guess you mean the :headers key inside :responses

ulsa11:08:57

sorry for being unclear

juhoteperi11:08:12

and I would say it’s only used for swagger docs, no validation

ulsa11:08:50

Yes, it seems no validation occurs. I don't see anything in swagger-ui under headers, though.

juhoteperi11:08:44

Swagger-ui doesn’t necessarily support full Swagger-spec

juhoteperi11:08:15

Or could be we are formatting them wrong

juhoteperi11:08:07

Looks like Swagger-spec examples don’t have example of response headers either

ulsa11:08:09

thx, I'll drop this then

ulsa11:08:14

now for a question about path-for:

ulsa11:08:03

I have this: (POST* "/companies/:company-id/refresh" [] :name :refresh-company ...

ulsa11:08:37

and refer to it like this: (found (path-for :refresh-company {:company-id id}))

ulsa11:08:09

but get in Location this:

ulsa11:08:25

ie, missing the trailing refresh

juhoteperi12:08:46

Looks like a bug with c-api. Would be nice if you could open an issue.