From 065dc9606a8e178c95a46c8d3d9cf7e505b4bb5b Mon Sep 17 00:00:00 2001 From: Mohammed Madi Date: Mon, 11 Mar 2024 17:40:39 +0000 Subject: [PATCH] Add missing doc page and fix lint --- docs/api/paths/diagnostic/keyspace-sync.yaml | 61 ++++++++++++++++++++ rest/diagnostic_doc_api.go | 2 +- 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 docs/api/paths/diagnostic/keyspace-sync.yaml diff --git a/docs/api/paths/diagnostic/keyspace-sync.yaml b/docs/api/paths/diagnostic/keyspace-sync.yaml new file mode 100644 index 0000000000..ee503af9df --- /dev/null +++ b/docs/api/paths/diagnostic/keyspace-sync.yaml @@ -0,0 +1,61 @@ +# Copyright 2024-Present Couchbase, Inc. +# +# Use of this software is governed by the Business Source License included +# in the file licenses/BSL-Couchbase.txt. As of the Change Date specified +# in that file, in accordance with the Business Source License, use of this +# software will be governed by the Apache License, Version 2.0, included in +# the file licenses/APL2.txt. +parameters: + - $ref: ../../components/parameters.yaml#/keyspace +get: + summary: Run a doc body through the sync function and return sync data. + description: |- + Run a document body through the sync function and return document sync data. + * Sync Gateway Application Read Only + requestBody: + content: + application/json: + schema: + $ref: ../../components/schemas.yaml#/Document + responses: + '200': + description: Document Processed by sync function successfully + content: + application/json: + schema: + type: object + properties: + channels: + description: The channels the document was placed in by the sync function. + type: array + roles: + description: An access map of roles granted by the sync function. + type: object + properties: + username: + type: object + additionalProperties: + x-additionalPropertiesName: role + type: string + access: + description: An access map of dynamic channels granted by the sync function. + type: object + properties: + username: + type: object + additionalProperties: + x-additionalPropertiesName: channel + type: string + + exception: + description: Errors thrown by the sync function. + type: string + + '404': + $ref: ../../components/responses.yaml#/Not-found + parameters: + - $ref: ../../components/parameters.yaml#/docid + - $ref: ../../components/parameters.yaml#/rev + tags: + - Document + operationId: get_keyspace-sync diff --git a/rest/diagnostic_doc_api.go b/rest/diagnostic_doc_api.go index 59bf9c4d88..dd98fcae13 100644 --- a/rest/diagnostic_doc_api.go +++ b/rest/diagnostic_doc_api.go @@ -79,7 +79,7 @@ func (h *handler) handleSyncFnDryRun() error { access, roles, errorMsg, - uint32(expiry), + expiry, } h.writeJSON(resp)