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