mirror of
https://github.com/aelve/guide.git
synced 2024-12-23 12:52:31 +03:00
Fix errors in the API
This commit is contained in:
parent
a1058bcd2f
commit
0a309bbff4
@ -92,14 +92,13 @@ data CategorySite route = CategorySite
|
||||
:> Description "Returns the ID of the created category.\n\n\
|
||||
\If a category with the same title already exists, \
|
||||
\returns its ID instead."
|
||||
:> ErrorResponse 400 "'title' not provided"
|
||||
:> "category"
|
||||
:> QueryParam' '[Required, Strict] "title" Text
|
||||
:> Post '[JSON] (Uid Category)
|
||||
|
||||
, _deleteCategory :: route :-
|
||||
Summary "Delete a category"
|
||||
:> Description "Note: please ignore the 404 here, it's a bug \
|
||||
\in documentation. This endpoint does not return 404."
|
||||
:> "category"
|
||||
:> Capture "id" (Uid Category)
|
||||
:> Delete '[JSON] NoContent
|
||||
@ -111,6 +110,7 @@ data ItemSite route = ItemSite
|
||||
{ _createItem :: route :-
|
||||
Summary "Create a new item in the given category"
|
||||
:> Description "Returns the ID of the created item."
|
||||
:> ErrorResponse 400 "'name' not provided"
|
||||
:> "item"
|
||||
:> Capture "category" (Uid Category)
|
||||
:> QueryParam' '[Required, Strict] "name" Text
|
||||
@ -118,8 +118,6 @@ data ItemSite route = ItemSite
|
||||
|
||||
, _deleteItem :: route :-
|
||||
Summary "Delete an item"
|
||||
:> Description "Note: please ignore the 404 here, it's a bug \
|
||||
\in documentation. This endpoint does not return 404."
|
||||
:> "item"
|
||||
:> Capture "id" (Uid Item)
|
||||
:> Delete '[JSON] NoContent
|
||||
@ -130,8 +128,6 @@ data ItemSite route = ItemSite
|
||||
data TraitSite route = TraitSite
|
||||
{ _deleteTrait :: route :-
|
||||
Summary "Delete a trait"
|
||||
:> Description "Note: please ignore the 404 here, it's a bug \
|
||||
\in documentation. This endpoint does not return 404."
|
||||
:> "item"
|
||||
:> Capture "item" (Uid Item)
|
||||
:> "trait"
|
||||
@ -145,6 +141,7 @@ data SearchSite route = SearchSite
|
||||
{ _search :: route :-
|
||||
Summary "Search categories and items"
|
||||
:> Description "Returns at most 100 search results"
|
||||
:> ErrorResponse 400 "'query' not provided"
|
||||
:> "search"
|
||||
:> QueryParam' '[Required, Strict] "query" Text
|
||||
:> Get '[JSON] [CSearchResult]
|
||||
|
15
stack.yaml
15
stack.yaml
@ -22,17 +22,26 @@ extra-deps:
|
||||
- servant-swagger-ui-0.3.0.3.13.2
|
||||
- file-embed-lzma-0
|
||||
- servant-0.14.1
|
||||
- servant-swagger-1.1.5
|
||||
- servant-swagger-ui-core-0.3.1
|
||||
- swagger2-2.3
|
||||
- lzma-clib-5.2.2
|
||||
- git: https://github.com/neongreen/patches-vector
|
||||
commit: 9bb704cf7f14cff9ef76a5d177e4e56ceee24705
|
||||
|
||||
- git: https://github.com/aelve/stache-plus
|
||||
commit: c8097fb33df6ba738fc7b7c8d09aaebdb02a9782
|
||||
|
||||
- git: https://github.com/aelve/safecopy-migrate
|
||||
commit: c401315122f04624e5e848d77f9eaa948e38c21b
|
||||
|
||||
# Fork of 'servant-swagger' with some changes (see its README)
|
||||
- git: https://github.com/aelve/servant-swagger
|
||||
commit: 09e124d03606ec54d50e3029ea86d096575d545c
|
||||
|
||||
# Fork of 'hspec-webdriver' that builds
|
||||
- git: https://github.com/neongreen/webdriver-utils
|
||||
commit: db4a9027e62550c9d27110f36ae26c712acfbe95
|
||||
subdirs:
|
||||
- hspec-webdriver
|
||||
|
||||
# Fork of 'patches-vector' that builds
|
||||
- git: https://github.com/neongreen/patches-vector
|
||||
commit: 9bb704cf7f14cff9ef76a5d177e4e56ceee24705
|
||||
|
Loading…
Reference in New Issue
Block a user