Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documenting request body #168

Closed
dzhus opened this issue Sep 29, 2015 · 5 comments
Closed

Documenting request body #168

dzhus opened this issue Sep 29, 2015 · 5 comments
Labels

Comments

@dzhus
Copy link
Contributor

dzhus commented Sep 29, 2015

With compojure-api-0.24.0, specifying documentation for body schema with

:body [body (describe {:articles [Article]} "New content")]

for a route does not produce any documentation for body parameter in swagger spec.

@ikitommi
Copy link
Member

hi. does the s/named work with that?

@vincentbernat
Copy link

Hey!

I run into the same problem: no description. Using s/named doesn't change anything:

:body [log (s/named schema/LogEntry "log entry to append")]

Also, is it possible to give a name to this "parameter" instead of "Body24502"?

@ikitommi ikitommi added the bug label Dec 9, 2015
@ikitommi
Copy link
Member

ikitommi commented Dec 9, 2015

should be possible. will check this one out.

@ikitommi
Copy link
Member

Sorry for taking so long.

Naming an anonymous body schema:

(POST "/some" []
  :body [body (s/schema-with-name {:kikka String} "Kikka")]
  (ok body))

Adding description to body schema fixed in 1.1.0-SNAPSHOT:

(POST "/some" []
  :body [body (describe {:kikka String} "this is kikka")]
  (ok body))

Together:

(POST "/some" []
  :body [body (describe (s/schema-with-name {:kikka String} "Kikka") "this is kikka")]
  (ok body))

After implementing this feature, can add support for more declarative schemas.

@dzhus
Copy link
Contributor Author

dzhus commented Apr 25, 2016

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants