generated from coulomb/repo-seed
feat: add v2 hub and widget create endpoints
Some checks failed
Build and Deploy / build-push-deploy (push) Has been cancelled
Some checks failed
Build and Deploy / build-push-deploy (push) Has been cancelled
This commit is contained in:
@@ -84,6 +84,7 @@ buildOpenApiSpec = do
|
||||
, "total" .= object ["type" .= ("integer" :: Text)]
|
||||
]
|
||||
]
|
||||
, "Hub" .= hubSchema
|
||||
, "Widget" .= widgetSchema
|
||||
, "InteractionEvent" .= interactionEventSchema
|
||||
, "Annotation" .= annotationSchema
|
||||
@@ -108,7 +109,15 @@ buildOpenApiSpec = do
|
||||
|
||||
buildPaths :: Value
|
||||
buildPaths = object
|
||||
[ "/widgets" .= getListPath "Widget"
|
||||
[ "/hubs" .= object
|
||||
[ "get" .= listOp "Hub" []
|
||||
, "post" .= writeOp "Hub" "CreateHubRequest"
|
||||
]
|
||||
, "/hubs/{id}" .= getShowPath "Hub"
|
||||
, "/widgets" .= object
|
||||
[ "get" .= listOp "Widget" []
|
||||
, "post" .= writeOp "Widget" "CreateWidgetRequest"
|
||||
]
|
||||
, "/widgets/{id}" .= getShowPath "Widget"
|
||||
, "/interaction-events" .= object
|
||||
[ "get" .= listOp "InteractionEvent"
|
||||
@@ -266,6 +275,19 @@ pageParams =
|
||||
|
||||
-- Schemas for all resource types
|
||||
|
||||
hubSchema :: Value
|
||||
hubSchema = object
|
||||
[ "type" .= ("object" :: Text)
|
||||
, "properties" .= object
|
||||
[ "id" .= uuidProp
|
||||
, "slug" .= strProp
|
||||
, "name" .= strProp
|
||||
, "domain" .= strProp
|
||||
, "hubKind" .= object ["type" .= ("string" :: Text), "enum" .= ["domain" :: Text, "shared"]]
|
||||
, "createdAt" .= object ["type" .= ("string" :: Text), "format" .= ("date-time" :: Text)]
|
||||
]
|
||||
]
|
||||
|
||||
widgetSchema :: Value
|
||||
widgetSchema = object
|
||||
[ "type" .= ("object" :: Text)
|
||||
|
||||
Reference in New Issue
Block a user