Skip to content

Conversation

@bbrks
Copy link
Member

@bbrks bbrks commented Jan 14, 2026

Updates to Diagnostic API OpenAPI Specs to align with desired implementation and cleanup.

  • Import Filter Dry-run API:
    • Added doc / doc_id table to description similar to Sync Function API
  • Sync Function Dry-run API:
    • Added meta request property for upcoming user xattrs support
    • Added userCtx request property for upcoming user/channel/role impersonation support
    • Added expiry response property to document current implementation
  • Both APIs:
    • Simplified doc schema to make it obvious it's a user-defined doc body, no metadata required.
    • Switch GET to POST and move doc_id query param to request body param
    • Share schemas for common diagnostic api dry-run response fields (exception, logging)
    • Added better/more example values for preview
Screenshot 2026-01-14 at 12 02 26 Screenshot 2026-01-14 at 12 02 08

Integration Tests

  • n/a

@bbrks bbrks requested a review from RIT3shSapata January 14, 2026 12:04
Copilot AI review requested due to automatic review settings January 14, 2026 12:04
@github-actions
Copy link

Redocly previews

Copy link
Contributor

Copilot AI left a 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 updates the OpenAPI specifications for the Diagnostic API's dry-run endpoints (Sync Function and Import Filter) to align with the desired implementation and improve documentation clarity.

Changes:

  • Converted both endpoints from GET to POST and moved doc_id from query parameter to request body
  • Added new request properties (meta, userCtx) to Sync Function API for upcoming user xattrs support and user/channel/role impersonation
  • Added expiry response property to Sync Function API to document current implementation
  • Simplified doc schema definition and improved documentation with clearer behavior tables
  • Introduced shared schemas for common diagnostic API response fields (DiagnosticFunctionException, DiagnosticFunctionLogging)

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
docs/api/paths/diagnostic/keyspace-sync.yaml Updated Sync Function dry-run API endpoint: changed HTTP method to POST, moved doc_id to request body, added meta and userCtx request properties, added expiry response property, improved documentation with clearer behavior table and examples
docs/api/paths/diagnostic/keyspace-import_filter.yaml Updated Import Filter dry-run API endpoint: changed HTTP method to POST, moved doc_id to request body, added behavior table similar to Sync Function API, simplified doc schema, switched to shared schema references for exception and logging fields
docs/api/components/schemas.yaml Added two new shared schemas (DiagnosticFunctionException and DiagnosticFunctionLogging) for common diagnostic API response fields

Comment on lines +62 to +86
properties:
additionalProperties:
x-additionalPropertiesName: user_xattr_key
description: The user XATTR JSON value. The property name must exactly match the configured `user_xattr_key`. The value can be any valid JSON type (Object, String, Number, etc.)
oneOf:
- type: object
additionalProperties: true
example:
foo: bar
description: An object value to be used as the user XATTR.
- type: string
example: foo
description: A string value to be used as the user XATTR.
- type: integer
example: 100
description: A number value to be used as the user XATTR.
- type: boolean
example: true
description: A boolean value to be used as the user XATTR.
- type: array
items:
example:
- foo
- bar
description: An array of values to be used as the user XATTR.
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The additionalProperties keyword should not be nested under properties. It should be a sibling to properties at the same level. Move additionalProperties out of the properties block and place it as a direct child of the xattrs object schema.

Suggested change
properties:
additionalProperties:
x-additionalPropertiesName: user_xattr_key
description: The user XATTR JSON value. The property name must exactly match the configured `user_xattr_key`. The value can be any valid JSON type (Object, String, Number, etc.)
oneOf:
- type: object
additionalProperties: true
example:
foo: bar
description: An object value to be used as the user XATTR.
- type: string
example: foo
description: A string value to be used as the user XATTR.
- type: integer
example: 100
description: A number value to be used as the user XATTR.
- type: boolean
example: true
description: A boolean value to be used as the user XATTR.
- type: array
items:
example:
- foo
- bar
description: An array of values to be used as the user XATTR.
additionalProperties:
x-additionalPropertiesName: user_xattr_key
description: The user XATTR JSON value. The property name must exactly match the configured `user_xattr_key`. The value can be any valid JSON type (Object, String, Number, etc.)
oneOf:
- type: object
additionalProperties: true
example:
foo: bar
description: An object value to be used as the user XATTR.
- type: string
example: foo
description: A string value to be used as the user XATTR.
- type: integer
example: 100
description: A number value to be used as the user XATTR.
- type: boolean
example: true
description: A boolean value to be used as the user XATTR.
- type: array
items:
example:
- foo
- bar
description: An array of values to be used as the user XATTR.

Copilot uses AI. Check for mistakes.
Comment on lines +83 to +87
example:
- foo
- bar
description: An array of values to be used as the user XATTR.

Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example field for array items should be a single value, not an array. The outer items already indicates this is describing individual array elements. Change the example to a single value like "foo" instead of ["foo", "bar"].

Suggested change
example:
- foo
- bar
description: An array of values to be used as the user XATTR.
example: foo
description: An array of values to be used as the user XATTR.

Copilot uses AI. Check for mistakes.
Comment on lines +17 to +22
| `doc` property | `doc_id` property | Behaviour |
| ----- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Set | Unset | The document body passed will be the `doc` value in the sync function, and `oldDoc` will be empty. |
| Unset | Set | The document of the given id will be fetched from the bucket/collection and will be passed in as the `doc` value in the sync function. If the document is not found, an error will be returned |
| Set | Set | The document body passed will be the `doc` value in the sync function, and the `doc_id` will be fetched from the bucket/collection and will be the `oldDoc` value. If `doc_id` doesn't exist, then `oldDoc` will be empty |
| Unset | Unset | Will throw an error (at least one of `doc` or `doc_id` is required) |
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The table header alignment is inconsistent. The separator row shows different column widths (----- vs --------) than the actual content requires. Adjust the separator to match the column widths consistently.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@RIT3shSapata RIT3shSapata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@RIT3shSapata RIT3shSapata merged commit 97936f5 into main Jan 14, 2026
29 checks passed
@RIT3shSapata RIT3shSapata deleted the cleanup_diagnostic_api_docs branch January 14, 2026 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants