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

Which content type to prefer for swagger docs? #13

Open
fizruk opened this issue Jan 9, 2016 · 3 comments
Open

Which content type to prefer for swagger docs? #13

fizruk opened this issue Jan 9, 2016 · 3 comments

Comments

@fizruk
Copy link
Member

fizruk commented Jan 9, 2016

Suppose this API:

type SampleAPI = "sample" :> Get '[JSON, FormUrlEncoded, XML] Sample

Should we use a body param with Swagger Schema or formData params?
With swagger spec it does not seem to make sense having both.
It also appears we can't have duplicate paths with different params.

I tend to think that we should just pick the first content type of the list (if any).
The other option might be to pick one of the most precedence (e.g. prefer JSON then FormUrlEncoded).

@dmjio
Copy link
Member

dmjio commented Jan 9, 2016

Highest precedence sounds good (or first). I think this will be a corner case. I've never come across an API that returned both JSON and FormUrlEncoded data (although I have seen (X)HTML and JSON).

@phadej
Copy link
Contributor

phadej commented Feb 1, 2017

There are APIs returning JSON, YAML and EDN...

fisx pushed a commit to wireapp/servant-swagger that referenced this issue Jun 1, 2019
…aults

Prefer gundeck's default for nativeEncrypt
@akhesaCaro
Copy link
Contributor

Hi,
Servant-swagger will be moved into the main Servant repo (see : haskell-servant/servant#1475)
If this issue is still relevant, would it be possible for you to summit it there? : https://github.com/haskell-servant/servant/issues

Thanks in advance!

maksbotan pushed a commit to biocad/servant-swagger that referenced this issue Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants