Skip to main content

Read from CDoc collection

Motivation​

Read CDoc collection using API

Functional design​

GET /api/v2/apps/{owner}/{app}/workspaces/{wsid}/cdocs/{pkg}.{table}

Headers​

KeyValue
AuthorizationBearer {PrincipalToken}

Parameters​

ParameterTypeDescription
ownerstringname of a user who owns the application
appstringname of an application
wsidint64the ID of workspace
pkg, tablestringidentifies a table

Also supports Query constraints

Result​

CodeDescriptionBody
200OKJSON object that contains a results field with a JSON array that lists the objects, example. When the error happens during the read, the error property is added in the response
401Unauthorizederror object
403Forbiddenerror object
404Table Not Founderror object

Technical design​

Components​

  • pkg/processors/query2
    • IApiPathHandler implementation for handling ApiPath_CDocs
      • ~cmp.cdocsHandler~covrd1✅
    • newQueryProcessorPipeline: provide API handler for ApiPath_CDocs
      • ~cmp.provideCDocsHandler~covrd2✅
    • check ACL when including referenced objects and/or containers (same as for /docs)
  • pkg/sys/it
    • integration test for /cdocs/
      • ~it.TestQueryProcessor2_CDocs~covrd3✅

Footnotes​

  1. [~server.apiv2.docs/cmp.cdocsHandler~impl] pkg/processors/query2/impl_cdocs_handler.go:23:impl ↩

  2. [~server.apiv2.docs/cmp.provideCDocsHandler~impl] pkg/processors/query2/impl.go:139:impl ↩

  3. [~server.apiv2.docs/it.TestQueryProcessor2_CDocs~impl] pkg/sys/it/impl_qpv2_test.go:2502:impl ↩