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

Use swagger2 for data model #9

Merged
merged 35 commits into from
Dec 31, 2015
Merged

Use swagger2 for data model #9

merged 35 commits into from
Dec 31, 2015

Conversation

fizruk
Copy link
Member

@fizruk fizruk commented Dec 22, 2015

Closes #8.

This PR is incomplete, please do not merge yet.

@dmjio
Copy link
Member

dmjio commented Dec 22, 2015

K

Sent from my iPhone

On Dec 22, 2015, at 1:10 PM, Nickolay Kudasov [email protected] wrote:

Closes #8.

This PR is incomplete, please do not merge yet.

You can view, comment on, or merge this pull request online at:

#9

Commit Summary

Add some commonly ignored files to .gitignore
Clear everything and add HasSwagger with instances for Post
Add HasSwagger instances for :<|> and :>
Add HasSwagger instance for Capture
Add HasSwagger instance for QueryParam
Add HasSwagger instance for QueryParams
Add HasSwagger instance for QueryFlag
Add HasSwagger instances for matrix params and flags
Add HasSwagger instance for Header
Add HasSwagger instance for ReqBody
Fix trailing slashes
Fix HasSwagger Raw instance
Allow HList in Headers as servant does
Add HasSwagger instance for Get
Add test suite with Todo API example
Add HasSwagger instances for the rest of servant methods
File Changes

M .gitignore (17)
M servant-swagger.cabal (40)
M src/Servant/Swagger.hs (108)
M src/Servant/Swagger/Internal.hs (1245)
A test/Servant/SwaggerSpec.hs (100)
A test/Spec.hs (1)
Patch Links:

https://github.com/dmjio/servant-swagger/pull/9.patch
https://github.com/dmjio/servant-swagger/pull/9.diff

Reply to this email directly or view it on GitHub.

@fizruk
Copy link
Member Author

fizruk commented Dec 23, 2015

Things to do before merge:

  • handle formData (probably with an instance for ReqBody '[FormUrlEncoded] a :> sub);
  • add/reuse ToSample for schema examples;
  • add helpers to annotate API with tags;
  • add helpers to add/remove responses;
  • add tons of tests/examples.

@fizruk
Copy link
Member Author

fizruk commented Dec 25, 2015

Okay, I think schema examples and form data should be addressed in swagger2 first (see GetShopTV/swagger2#30 and GetShopTV/swagger2#31).

For tags/responses and other sub API / endpoint manipulation subOperations should do the job (see Hackage API example).

I am going to write some more examples/tests now.

fizruk added a commit that referenced this pull request Dec 31, 2015
Use swagger2 for data model
@fizruk fizruk merged commit d148710 into haskell-servant:master Dec 31, 2015
@fizruk fizruk deleted the swagger2-#8 branch December 31, 2015 00:05
This was referenced Dec 31, 2015
fisx pushed a commit to wireapp/servant-swagger that referenced this pull request Jun 1, 2019
maksbotan added a commit to biocad/servant-swagger that referenced this pull request 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

Successfully merging this pull request may close these issues.

2 participants