-
Notifications
You must be signed in to change notification settings - Fork 141
CBG-5103: DocID for Diagnostic API to be passed in request body instead of query param #7956
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
bbd284d to
589fd8c
Compare
02d8ddc to
9a517d4
Compare
589fd8c to
7100ade
Compare
3a5e69e to
13cf0a7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR modifies the Diagnostic API endpoints /_sync and /_import_filter to accept the document ID in the request body instead of as a query parameter, improving consistency with REST API best practices.
Changes:
- Document ID (
doc_id) is now read from the request body instead of query parameters for both sync function and import filter dry run endpoints - The
Errorfield inImportFilterDryRunresponse has been renamed toExceptionfor consistency - All test cases have been updated to reflect the new request body format
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| rest/diagnostic_doc_api.go | Modified handlers to read doc_id from request body; added DocID field to payload structs; renamed Error to Exception in response struct |
| rest/diagnostic_doc_api_test.go | Updated all test cases to pass doc_id in request body instead of query parameter; updated expected response field from Error to Exception |
| docid := syncDryRunPayload.DocID | ||
| if syncDryRunPayload.Doc == nil && docid == "" { |
Copilot
AI
Jan 16, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable docid uses inconsistent naming. The payload field is DocID (camelCase with capitalized ID), but the variable is docid (lowercase). Consider renaming to docID for consistency with Go naming conventions where acronyms should be consistently capitalized.
| docid := importFilterPayload.DocID | ||
| // Cannot pass both doc_id and body in the request body |
Copilot
AI
Jan 16, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable docid uses inconsistent naming. The payload field is DocID (camelCase with capitalized ID), but the variable is docid (lowercase). Consider renaming to docID for consistency with Go naming conventions where acronyms should be consistently capitalized.
…ad of query param (#7956)
…ad of query param (#7956)
CBG-5103
Describe your PR here...
Pre-review checklist
fmt.Print,log.Print, ...)base.UD(docID),base.MD(dbName))docs/apiDependencies (if applicable)
Integration Tests
GSI=true,xattrs=truehttps://jenkins.sgwdev.com/job/SyncGatewayIntegration/222/