From 8273f9c9f2b314a2ba065d29d1f99919221b5b2a Mon Sep 17 00:00:00 2001 From: Chinmaya Singal Date: Thu, 14 May 2026 18:50:21 +0530 Subject: [PATCH 1/2] Add smoke test for Custom Metadata SDK grouping Asserts that the five Custom Metadata operations exposed by the overlay end up under x-speakeasy-group: indexing.customMetadata with the expected x-speakeasy-name-override values, so a future overlay reorder or upstream schema rename surfaces as a test failure rather than silent SDK drift. This test was originally part of #101 but removed before merge because the regen pipeline hadn't yet committed a fresh overlayed_specs/glean-merged-spec.yaml. With that file now in place on main, the assertion is meaningful again. Co-Authored-By: Claude Opus 4.7 (1M context) --- tests/post_transform_smoke.test.js | 41 ++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/tests/post_transform_smoke.test.js b/tests/post_transform_smoke.test.js index 0ef3439f..de25ec79 100644 --- a/tests/post_transform_smoke.test.js +++ b/tests/post_transform_smoke.test.js @@ -67,4 +67,45 @@ describe('Post-transformation smoke tests', () => { expect(hasUnexpected).toBe(false); }); + + test('Custom Metadata operations land under indexing.customMetadata SDK group', () => { + const customMetadataOps = [ + { + path: '/rest/api/index/document/{docId}/custom-metadata/{groupName}', + method: 'put', + nameOverride: 'upsert', + }, + { + path: '/rest/api/index/document/{docId}/custom-metadata/{groupName}', + method: 'delete', + nameOverride: 'delete', + }, + { + path: '/rest/api/index/custom-metadata/schema/{groupName}', + method: 'get', + nameOverride: 'getSchema', + }, + { + path: '/rest/api/index/custom-metadata/schema/{groupName}', + method: 'put', + nameOverride: 'upsertSchema', + }, + { + path: '/rest/api/index/custom-metadata/schema/{groupName}', + method: 'delete', + nameOverride: 'deleteSchema', + }, + ]; + + for (const { path, method, nameOverride } of customMetadataOps) { + const operation = spec.paths?.[path]?.[method]; + + expect( + operation, + `expected operation ${method.toUpperCase()} ${path}`, + ).toBeDefined(); + expect(operation['x-speakeasy-group']).toBe('indexing.customMetadata'); + expect(operation['x-speakeasy-name-override']).toBe(nameOverride); + } + }); }); From 4f3f491e6391fbd9cc6f7ee38a7ce7edcc8e33bb Mon Sep 17 00:00:00 2001 From: Chinmaya Singal Date: Thu, 14 May 2026 18:53:55 +0530 Subject: [PATCH 2/2] Assert CustomMetadataSchema narrowing via CustomMetadataPropertyDefinition The overlay introduces a Custom Metadata-specific PropertyDefinition schema (exposing only name, propertyType, and skipIndexing) and re-points CustomMetadataSchema.metadataKeys.items at it. This test locks both halves down so that neither an upstream rename of CustomMetadataSchema/PropertyDefinition nor a future overlay reorder can silently revert the narrowing. Co-Authored-By: Claude Opus 4.7 (1M context) --- tests/post_transform_smoke.test.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/post_transform_smoke.test.js b/tests/post_transform_smoke.test.js index de25ec79..9aeb761f 100644 --- a/tests/post_transform_smoke.test.js +++ b/tests/post_transform_smoke.test.js @@ -108,4 +108,26 @@ describe('Post-transformation smoke tests', () => { expect(operation['x-speakeasy-name-override']).toBe(nameOverride); } }); + + test('CustomMetadataSchema is narrowed via CustomMetadataPropertyDefinition', () => { + const schemas = spec.components?.schemas ?? {}; + + const propertyDef = schemas.CustomMetadataPropertyDefinition; + expect( + propertyDef, + 'CustomMetadataPropertyDefinition schema', + ).toBeDefined(); + expect(Object.keys(propertyDef.properties ?? {}).sort()).toEqual([ + 'name', + 'propertyType', + 'skipIndexing', + ]); + expect(propertyDef.required).toEqual(['name', 'propertyType']); + + const customMetadataSchema = schemas.CustomMetadataSchema; + expect(customMetadataSchema, 'CustomMetadataSchema').toBeDefined(); + expect(customMetadataSchema.properties?.metadataKeys?.items?.$ref).toBe( + '#/components/schemas/CustomMetadataPropertyDefinition', + ); + }); });