From e406944e237f58476c53b8148e6338d1e07b9105 Mon Sep 17 00:00:00 2001 From: dsinghvi Date: Wed, 9 Oct 2024 21:41:54 -0400 Subject: [PATCH] fix: actually get extra-properties wired up in fdr --- fern/apis/fdr/definition/api/v1/read/type.yml | 1 + fern/apis/fdr/definition/api/v1/register/type.yml | 1 + packages/fdr-sdk/src/api-definition/migrators/v1ToV2.ts | 3 ++- .../v1/resources/read/resources/type/types/ObjectType.ts | 1 + .../v1/resources/register/resources/type/types/ObjectType.ts | 1 + packages/fdr-sdk/src/converters/db/convertAPIDefinitionToDb.ts | 2 ++ .../v1/resources/read/resources/type/types/ObjectType.d.ts | 1 + .../v1/resources/register/resources/type/types/ObjectType.d.ts | 1 + 8 files changed, 10 insertions(+), 1 deletion(-) diff --git a/fern/apis/fdr/definition/api/v1/read/type.yml b/fern/apis/fdr/definition/api/v1/read/type.yml index 7cac35b1f8..1876c3f680 100644 --- a/fern/apis/fdr/definition/api/v1/read/type.yml +++ b/fern/apis/fdr/definition/api/v1/read/type.yml @@ -45,6 +45,7 @@ types: properties: extends: list properties: list + extraProperties: optional ObjectProperty: extends: diff --git a/fern/apis/fdr/definition/api/v1/register/type.yml b/fern/apis/fdr/definition/api/v1/register/type.yml index e178fc86f0..d4894fceaf 100644 --- a/fern/apis/fdr/definition/api/v1/register/type.yml +++ b/fern/apis/fdr/definition/api/v1/register/type.yml @@ -45,6 +45,7 @@ types: properties: extends: list properties: list + extraProperties: optional ObjectProperty: extends: diff --git a/packages/fdr-sdk/src/api-definition/migrators/v1ToV2.ts b/packages/fdr-sdk/src/api-definition/migrators/v1ToV2.ts index 0476fd7853..540ed757d1 100644 --- a/packages/fdr-sdk/src/api-definition/migrators/v1ToV2.ts +++ b/packages/fdr-sdk/src/api-definition/migrators/v1ToV2.ts @@ -280,7 +280,8 @@ export class ApiDefinitionV1ToLatest { type: "object", extends: value.extends, properties: this.migrateObjectProperties(value.properties), - extraProperties: undefined, + extraProperties: + value.extraProperties != null ? this.migrateTypeReference(value.extraProperties) : undefined, }), alias: (value) => ({ type: "alias", diff --git a/packages/fdr-sdk/src/client/generated/api/resources/api/resources/v1/resources/read/resources/type/types/ObjectType.ts b/packages/fdr-sdk/src/client/generated/api/resources/api/resources/v1/resources/read/resources/type/types/ObjectType.ts index a63089f1ef..65bd894d63 100644 --- a/packages/fdr-sdk/src/client/generated/api/resources/api/resources/v1/resources/read/resources/type/types/ObjectType.ts +++ b/packages/fdr-sdk/src/client/generated/api/resources/api/resources/v1/resources/read/resources/type/types/ObjectType.ts @@ -7,4 +7,5 @@ import * as FernRegistry from "../../../../../../../../../index"; export interface ObjectType { extends: FernRegistry.TypeId[]; properties: FernRegistry.api.v1.read.ObjectProperty[]; + extraProperties: FernRegistry.api.v1.read.TypeReference | undefined; } diff --git a/packages/fdr-sdk/src/client/generated/api/resources/api/resources/v1/resources/register/resources/type/types/ObjectType.ts b/packages/fdr-sdk/src/client/generated/api/resources/api/resources/v1/resources/register/resources/type/types/ObjectType.ts index 3572009463..7eebf134c3 100644 --- a/packages/fdr-sdk/src/client/generated/api/resources/api/resources/v1/resources/register/resources/type/types/ObjectType.ts +++ b/packages/fdr-sdk/src/client/generated/api/resources/api/resources/v1/resources/register/resources/type/types/ObjectType.ts @@ -7,4 +7,5 @@ import * as FernRegistry from "../../../../../../../../../index"; export interface ObjectType { extends: FernRegistry.TypeId[]; properties: FernRegistry.api.v1.register.ObjectProperty[]; + extraProperties: FernRegistry.api.v1.register.TypeReference | undefined; } diff --git a/packages/fdr-sdk/src/converters/db/convertAPIDefinitionToDb.ts b/packages/fdr-sdk/src/converters/db/convertAPIDefinitionToDb.ts index 50fb46271a..e4ab652119 100644 --- a/packages/fdr-sdk/src/converters/db/convertAPIDefinitionToDb.ts +++ b/packages/fdr-sdk/src/converters/db/convertAPIDefinitionToDb.ts @@ -569,6 +569,7 @@ function transformShape({ writeShape }: { writeShape: APIV1Write.TypeShape }): F type: "object", extends: writeShape.extends, properties: writeShape.properties.map((property) => transformProperty({ writeShape: property })), + extraProperties: writeShape.extraProperties, }; case "alias": return { @@ -644,6 +645,7 @@ function transformDiscriminatedVariant({ properties: writeShape.additionalProperties.properties.map((property) => transformProperty({ writeShape: property }), ), + extraProperties: undefined, }, }; } diff --git a/servers/fdr/src/api/generated/api/resources/api/resources/v1/resources/read/resources/type/types/ObjectType.d.ts b/servers/fdr/src/api/generated/api/resources/api/resources/v1/resources/read/resources/type/types/ObjectType.d.ts index c280793e44..105e2394cf 100644 --- a/servers/fdr/src/api/generated/api/resources/api/resources/v1/resources/read/resources/type/types/ObjectType.d.ts +++ b/servers/fdr/src/api/generated/api/resources/api/resources/v1/resources/read/resources/type/types/ObjectType.d.ts @@ -5,4 +5,5 @@ import * as FernRegistry from "../../../../../../../../../index"; export interface ObjectType { extends: FernRegistry.TypeId[]; properties: FernRegistry.api.v1.read.ObjectProperty[]; + extraProperties: FernRegistry.api.v1.read.TypeReference | undefined; } diff --git a/servers/fdr/src/api/generated/api/resources/api/resources/v1/resources/register/resources/type/types/ObjectType.d.ts b/servers/fdr/src/api/generated/api/resources/api/resources/v1/resources/register/resources/type/types/ObjectType.d.ts index e798753222..6de26b7491 100644 --- a/servers/fdr/src/api/generated/api/resources/api/resources/v1/resources/register/resources/type/types/ObjectType.d.ts +++ b/servers/fdr/src/api/generated/api/resources/api/resources/v1/resources/register/resources/type/types/ObjectType.d.ts @@ -5,4 +5,5 @@ import * as FernRegistry from "../../../../../../../../../index"; export interface ObjectType { extends: FernRegistry.TypeId[]; properties: FernRegistry.api.v1.register.ObjectProperty[]; + extraProperties: FernRegistry.api.v1.register.TypeReference | undefined; }