Skip to content

feat: add root query endpoint and POST /.search#199

Merged
q-uint merged 1 commit intomasterfrom
feat/root-query-endpoint
Mar 26, 2026
Merged

feat: add root query endpoint and POST /.search#199
q-uint merged 1 commit intomasterfrom
feat/root-query-endpoint

Conversation

@q-uint
Copy link
Copy Markdown
Collaborator

@q-uint q-uint commented Mar 26, 2026

Add GET / and POST /.search to query across all resource types. Introduce RootQueryHandler interface, WithRootQueryHandler server option, ValidateFilterForResourceTypes utility, and a raw Filter field on ListRequestParams. Fix filter validation to include common attributes (id, externalId, meta.*) so filters like meta.lastModified work on per-resource endpoints. Fix potential slice mutation in schema attribute appending.

Summary

  • Add GET / and POST /.search endpoints for cross-resource-type queries per RFC 7644 Sections 3.4.2.1 and 3.4.3
  • New RootQueryHandler interface and WithRootQueryHandler(h) server option
  • New ValidateFilterForResourceTypes utility for narrowing filters to matching resource types
  • Add raw Filter string to ListRequestParams for root queries where schema-based validation is not possible
  • rawResources() injects id, externalId, and Meta fields (created, lastModified, version) into root query responses
  • Extract parsePaginationParams to share count/startIndex logic between root and per-resource handlers
  • Bug fix: getFilterValidator and schemaWithCommon now include CommonAttributes() so filters on meta.lastModified, meta.resourceType, id, externalId no longer return 400 on per-resource endpoints
  • Bug fix: defensive slice copy in getFilterValidator, ValidateFilterForResourceTypes, and schemaWithCommon to avoid mutating the original schema's backing array

@q-uint q-uint self-assigned this Mar 26, 2026
Add GET / and POST /.search to query across all resource types.
Introduce RootQueryHandler interface, WithRootQueryHandler server
option, ValidateFilterForResourceTypes utility, and a raw Filter
field on ListRequestParams. Fix filter validation to include common
attributes (id, externalId, meta.*) so filters like
meta.lastModified work on per-resource endpoints. Fix potential
slice mutation in schema attribute appending.
@q-uint q-uint force-pushed the feat/root-query-endpoint branch from 97adde4 to 65d2497 Compare March 26, 2026 13:18
@q-uint q-uint merged commit db88816 into master Mar 26, 2026
8 checks passed
@q-uint q-uint deleted the feat/root-query-endpoint branch March 26, 2026 13:20
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.

1 participant