The Wayback Machine - https://web.archive.org/web/20200605064047/https://github.com/scalatra/scalatra/issues/627
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

Swagger support for operations with no response body #627

Open
salceson opened this issue Feb 27, 2017 · 4 comments
Open

Swagger support for operations with no response body #627

salceson opened this issue Feb 27, 2017 · 4 comments
Assignees

Comments

@salceson
Copy link

@salceson salceson commented Feb 27, 2017

We have an endpoint for validating a JSON file. When the file is valid we return HTTP status 200 with no response body. Currently it's not possible with Scalatra's Swagger support to register properly such an operation, although according to Swagger spec, it can be done.

Current workaround was to create a marker trait NoResponse and register the operation with this trait as response model.

I'd suggest we add possibility to handle such situations in better way :)

Also I'd like to thank you for your awesome work on this framework, especially for my request with Swagger that was resolved in the latest release 👍 .

@takezoe takezoe added the swagger label Feb 27, 2017
@salceson
Copy link
Author

@salceson salceson commented Mar 16, 2017

I'm sorry to take this long to response.

Yes, with apiOperation[Unit] it does work. I think that this needs to be better documented though. At least for me it isn't obvious that passing Unit type makes the operation return no response if succeeded.

@takezoe takezoe self-assigned this Apr 10, 2017
@jb08
Copy link

@jb08 jb08 commented May 8, 2017

also see swagger-ui PR into swagger-ui 3.0.7: link

@jb08
Copy link

@jb08 jb08 commented May 8, 2017

if you want more info on Unit type, also see scala docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.