Commit 6cb434bb authored by Nicolas Pouillard's avatar Nicolas Pouillard

API: use more specific names than "id" in captures

parent 62a89a42
Pipeline #635 failed with stage
...@@ -234,12 +234,13 @@ type GargPrivateAPI' = ...@@ -234,12 +234,13 @@ type GargPrivateAPI' =
-- Node endpoint -- Node endpoint
:<|> "node" :> Summary "Node endpoint" :<|> "node" :> Summary "Node endpoint"
:> Capture "id" NodeId :> NodeAPI HyperdataAny :> Capture "node_id" NodeId
:> NodeAPI HyperdataAny
-- Corpus endpoint -- Corpus endpoint
:<|> "corpus":> Summary "Corpus endpoint" :<|> "corpus":> Summary "Corpus endpoint"
:> Capture "id" CorpusId :> NodeAPI HyperdataCorpus :> Capture "corpus_id" CorpusId
:> NodeAPI HyperdataCorpus
:<|> "corpus":> Summary "Corpus endpoint" :<|> "corpus":> Summary "Corpus endpoint"
:> Capture "node1_id" NodeId :> Capture "node1_id" NodeId
...@@ -249,7 +250,8 @@ type GargPrivateAPI' = ...@@ -249,7 +250,8 @@ type GargPrivateAPI' =
-- Annuaire endpoint -- Annuaire endpoint
:<|> "annuaire":> Summary "Annuaire endpoint" :<|> "annuaire":> Summary "Annuaire endpoint"
:> Capture "id" AnnuaireId :> NodeAPI HyperdataAnnuaire :> Capture "annuaire_id" AnnuaireId
:> NodeAPI HyperdataAnnuaire
:<|> "annuaire" :> Summary "Contact endpoint" :<|> "annuaire" :> Summary "Contact endpoint"
:> Capture "annuaire_id" NodeId :> Capture "annuaire_id" NodeId
...@@ -258,7 +260,8 @@ type GargPrivateAPI' = ...@@ -258,7 +260,8 @@ type GargPrivateAPI' =
-- Document endpoint -- Document endpoint
:<|> "document":> Summary "Document endpoint" :<|> "document":> Summary "Document endpoint"
:> Capture "id" DocId :> "ngrams" :> TableNgramsApi :> Capture "doc_id" DocId
:> "ngrams" :> TableNgramsApi
-- :<|> "counts" :> Stream GET NewLineFraming '[JSON] Count :> CountAPI -- :<|> "counts" :> Stream GET NewLineFraming '[JSON] Count :> CountAPI
-- TODO-SECURITY -- TODO-SECURITY
...@@ -271,12 +274,14 @@ type GargPrivateAPI' = ...@@ -271,12 +274,14 @@ type GargPrivateAPI' =
-- TODO move to NodeAPI? -- TODO move to NodeAPI?
:<|> "graph" :> Summary "Graph endpoint" :<|> "graph" :> Summary "Graph endpoint"
:> Capture "id" NodeId :> GraphAPI :> Capture "graph_id" NodeId
:> GraphAPI
-- TODO move to NodeAPI? -- TODO move to NodeAPI?
-- Tree endpoint -- Tree endpoint
:<|> "tree" :> Summary "Tree endpoint" :<|> "tree" :> Summary "Tree endpoint"
:> Capture "id" NodeId :> TreeAPI :> Capture "tree_id" NodeId
:> TreeAPI
:<|> New.API_v2 :<|> New.API_v2
-- :<|> "scraper" :> WithCallbacks ScraperAPI -- :<|> "scraper" :> WithCallbacks ScraperAPI
...@@ -286,9 +291,9 @@ type GargPrivateAPI' = ...@@ -286,9 +291,9 @@ type GargPrivateAPI' =
-- /merge/<id>/<id> -- /merge/<id>/<id>
-- /rename/<id> -- /rename/<id>
-- :<|> "static" -- :<|> "static"
-- :<|> "list" :> Capture "id" Int :> NodeAPI -- :<|> "list" :> Capture "node_id" Int :> NodeAPI
-- :<|> "ngrams" :> Capture "id" Int :> NodeAPI -- :<|> "ngrams" :> Capture "node_id" Int :> NodeAPI
-- :<|> "auth" :> Capture "id" Int :> NodeAPI -- :<|> "auth" :> Capture "node_id" Int :> NodeAPI
--------------------------------------------------------------------- ---------------------------------------------------------------------
type SwaggerFrontAPI = SwaggerAPI :<|> FrontEndAPI type SwaggerFrontAPI = SwaggerAPI :<|> FrontEndAPI
......
...@@ -133,7 +133,7 @@ deriveJSON (unPrefix "_scst_") 'ScraperStatus ...@@ -133,7 +133,7 @@ deriveJSON (unPrefix "_scst_") 'ScraperStatus
type API_v2 = type API_v2 =
Summary "Add to corpus endpoint" :> Summary "Add to corpus endpoint" :>
"corpus" :> "corpus" :>
Capture "id" CorpusId :> Capture "corpus_id" CorpusId :>
"add" :> "add" :>
"async" :> ScraperAPI2 "async" :> ScraperAPI2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment