Add Custom Metadata overlay for SDK groups and PropertyDefinition narrowing#101
Add Custom Metadata overlay for SDK groups and PropertyDefinition narrowing#101chinmaya-singal-glean wants to merge 1 commit into
Conversation
…rowing Stacked on #100 — relies on the transformer fix to produce path keys under /rest/api/index, which is what this overlay's targets are written against. - Groups all 5 Custom Metadata endpoints under indexing.customMetadata in generated SDKs and applies clean method names (upsert, delete, getSchema, upsertSchema, deleteSchema). - Introduces a CustomMetadataPropertyDefinition schema that exposes only name, propertyType, and skipIndexing, and re-points CustomMetadataSchema.metadataKeys.items to it. The shared PropertyDefinition schema (used by the Datasource / Custom Properties API) carries fields that are not relevant to Custom Metadata; we cannot strip them from PropertyDefinition itself without affecting the Indexing API surface. - Registers the overlay in both glean-api-specs and glean-indexing-api-specs. The Custom Metadata endpoints themselves are still x-internal: true upstream in scio. This overlay is a no-op until that flag is removed in Phase 2; landing it here ahead of time so the SDK shape is in place when GA flips. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
| # Introduce a Custom Metadata-specific PropertyDefinition schema that exposes only | ||
| # the fields applicable to Custom Metadata. The shared PropertyDefinition schema | ||
| # (used by the Datasource / Custom Properties API) carries fields like displayLabel, | ||
| # displayLabelPlural, uiOptions, hideUiFacet, uiFacetOrder, and group that are not | ||
| # relevant to Custom Metadata. We cannot strip those fields from PropertyDefinition | ||
| # itself without affecting the Indexing API surface, so we create a | ||
| # narrower schema scoped to Custom Metadata and re-point CustomMetadataSchema to it. |
There was a problem hiding this comment.
This makes sense, but it's unfortunate to need an overlay here.
I presume it's not feasible to change the upstream so that the type that is actually shared is one that has the common properties because the type is currently in use?
|
A few things worth flagging before this lands. 1. PR description is stale The body says:
That's no longer accurate as of today — 2. The Grepping the current source spec for any schema named - target: $["components"]["schemas"]["CustomMetadataSchema"]["properties"]["metadataKeys"]
update:
items:
$ref: "#/components/schemas/CustomMetadataPropertyDefinition"…has nothing to update. The new Could you confirm whether (a) upstream is going to add a real 3. Minor: no overlay test Not blocking, but |
Summary
Stacked on #100 — depends on the transformer fix landing first so the path keys end up at
/rest/api/index/...(rather than the doubled-prefix variant the transformer currently produces for path-level-server endpoints).indexing.customMetadatain generated SDKs and applies clean method names (upsert,delete,getSchema,upsertSchema,deleteSchema).CustomMetadataPropertyDefinitionschema that exposes onlyname,propertyType, andskipIndexing, and re-pointsCustomMetadataSchema.metadataKeys.itemsto it. The sharedPropertyDefinitionschema (used by the Datasource / Custom Properties API) carries fields likedisplayLabel,displayLabelPlural,uiOptions,hideUiFacet,uiFacetOrder,groupthat are not relevant to Custom Metadata. We can't strip them fromPropertyDefinitionitself without affecting the Indexing API surface, so we narrow via a separate schema.glean-api-specsandglean-indexing-api-specs.Stacking
honor-path-level-servers-in-transformer(Honor path-level servers when prefixing path keys #100)main.Test plan
pnpm test— all tests pass🤖 Generated with Claude Code