From b6ae97a67f9d50093cdfd03b5526cdee103e0fb3 Mon Sep 17 00:00:00 2001 From: Deep Singhvi Date: Mon, 13 Jan 2025 16:24:37 -0500 Subject: [PATCH 1/6] chore(openrpc): introduce base openrpc node (#1997) --- packages/parsers/package.json | 1 + .../openrpc/BaseOpenApiV3_1Converter.node.ts | 60 +++++++++++++++++++ packages/parsers/src/openrpc/index.ts | 1 + pnpm-lock.yaml | 8 +++ 4 files changed, 70 insertions(+) create mode 100644 packages/parsers/src/openrpc/BaseOpenApiV3_1Converter.node.ts create mode 100644 packages/parsers/src/openrpc/index.ts diff --git a/packages/parsers/package.json b/packages/parsers/package.json index b3d4e5bfc5..7da1130aca 100644 --- a/packages/parsers/package.json +++ b/packages/parsers/package.json @@ -29,6 +29,7 @@ "dependencies": { "@fern-api/logger": "0.4.24-rc1", "@fern-api/ui-core-utils": "workspace:*", + "@open-rpc/meta-schema": "^1.14.9", "es-toolkit": "^1.24.0", "openapi-types": "^12.1.3", "ts-essentials": "^10.0.1", diff --git a/packages/parsers/src/openrpc/BaseOpenApiV3_1Converter.node.ts b/packages/parsers/src/openrpc/BaseOpenApiV3_1Converter.node.ts new file mode 100644 index 0000000000..ff18811ed5 --- /dev/null +++ b/packages/parsers/src/openrpc/BaseOpenApiV3_1Converter.node.ts @@ -0,0 +1,60 @@ +import type { OpenrpcDocument } from "@open-rpc/meta-schema"; +import { + BaseApiConverterNode, + BaseApiConverterNodeContext, +} from "../BaseApiConverter.node"; + +export abstract class BaseOpenrpc_ConverterNodeContext extends BaseApiConverterNodeContext { + public abstract document: OpenrpcDocument; +} + +export type BaseOpenrpc_ConverterNodeConstructorArgs = { + input: Input; + context: BaseOpenrpc_ConverterNodeContext; + readonly accessPath: string[]; + readonly pathId: string; +}; + +export abstract class BaseOpenApiV3_1ConverterNode< + Input, + Output, +> extends BaseApiConverterNode { + protected override readonly context: BaseOpenrpc_ConverterNodeContext; + protected readonly accessPath: string[]; + protected readonly pathId: string; + + constructor({ + input, + context, + accessPath, + pathId, + }: BaseOpenrpc_ConverterNodeConstructorArgs) { + super(input, context); + + this.context = context; + this.accessPath = [...accessPath]; + this.pathId = pathId; + + if ( + this.pathId && + this.pathId !== this.accessPath[this.accessPath.length - 1] + ) { + this.accessPath.push(this.pathId); + context.logger.debug(`Processing #/${this.accessPath.join("/")}`); + } + } + + abstract parse(...additionalArgs: unknown[]): void; + + safeParse(...additionalArgs: unknown[]): void { + try { + this.parse(...additionalArgs); + } catch { + this.context.errors.error({ + message: + "Error converting node. Please contact support if the error persists", + path: this.accessPath, + }); + } + } +} diff --git a/packages/parsers/src/openrpc/index.ts b/packages/parsers/src/openrpc/index.ts new file mode 100644 index 0000000000..bbe79f3042 --- /dev/null +++ b/packages/parsers/src/openrpc/index.ts @@ -0,0 +1 @@ +export * from "./BaseOpenApiV3_1Converter.node"; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0e72933c42..bdef822178 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2472,6 +2472,9 @@ importers: '@fern-api/ui-core-utils': specifier: workspace:* version: link:../commons/core-utils + '@open-rpc/meta-schema': + specifier: ^1.14.9 + version: 1.14.9 es-toolkit: specifier: ^1.24.0 version: 1.27.0 @@ -5496,6 +5499,9 @@ packages: resolution: {integrity: sha512-CyuLJ0/P7bKZ+kIYw+fnkeVdhUzNuDKgNSI7pU/m7Nod0T7kP+s4s2f0pNmG9HL8/RZN1S0ZWTDll3VTMrFLAw==} engines: {node: '>= 18'} + '@open-rpc/meta-schema@1.14.9': + resolution: {integrity: sha512-2/CbDzOVpcaSnMs28TsRv8MKJwJi0TTYFlQ6q6qobAH26oIuhYgcZooKf4l71emgntU6MMcFQCA0h4mJ4dBCdA==} + '@opentelemetry/api-logs@0.57.0': resolution: {integrity: sha512-l1aJ30CXeauVYaI+btiynHpw341LthkMTv3omi1VJDX14werY2Wmv9n1yudMsq9HuY0m8PvXEVX4d8zxEb+WRg==} engines: {node: '>=14'} @@ -20873,6 +20879,8 @@ snapshots: '@octokit/webhooks-types': 7.4.0 aggregate-error: 3.1.0 + '@open-rpc/meta-schema@1.14.9': {} + '@opentelemetry/api-logs@0.57.0': dependencies: '@opentelemetry/api': 1.9.0 From 7882bd7b6e8f3cff8c313404462373e77d60cdf6 Mon Sep 17 00:00:00 2001 From: Catherine Deskur <46695336+chdeskur@users.noreply.github.com> Date: Mon, 13 Jan 2025 16:50:49 -0500 Subject: [PATCH 2/6] feat: queue up nav config (#1999) --- fern/apis/fdr/definition/docs/v1/db/__package__.yml | 1 + fern/apis/fdr/definition/docs/v1/read/__package__.yml | 1 + fern/apis/fdr/definition/docs/v1/write/__package__.yml | 1 + packages/commons/fdr-utils/src/definition-object-factory.ts | 1 + .../docs/resources/v1/resources/db/types/DocsDbConfig.ts | 1 + .../docs/resources/v1/resources/read/types/DocsConfig.ts | 1 + .../resources/docs/resources/v1/resources/write/client/Client.ts | 1 + .../v1/resources/write/client/requests/RegisterDocsRequest.ts | 1 + .../docs/resources/v1/resources/write/types/DocsConfig.ts | 1 + .../resources/docs/resources/v2/resources/write/client/Client.ts | 1 + .../v2/resources/write/client/requests/RegisterDocsRequest.ts | 1 + packages/fdr-sdk/src/converters/db/convertDocsDefinitionToDb.ts | 1 + .../fdr-sdk/src/converters/read/convertDbDocsConfigToRead.ts | 1 + .../docs/resources/v1/resources/db/types/DocsDbConfig.ts | 1 + .../docs/resources/v1/resources/read/types/DocsConfig.ts | 1 + .../docs/resources/v1/resources/write/types/DocsConfig.ts | 1 + .../docs/resources/v1/resources/db/types/DocsDbConfig.d.ts | 1 + .../docs/resources/v1/resources/read/types/DocsConfig.d.ts | 1 + .../docs/resources/v1/resources/write/types/DocsConfig.d.ts | 1 + servers/fdr/src/healthchecks/checkRedis.ts | 1 + 20 files changed, 20 insertions(+) diff --git a/fern/apis/fdr/definition/docs/v1/db/__package__.yml b/fern/apis/fdr/definition/docs/v1/db/__package__.yml index 7520f5a809..eaae9d2d6b 100644 --- a/fern/apis/fdr/definition/docs/v1/db/__package__.yml +++ b/fern/apis/fdr/definition/docs/v1/db/__package__.yml @@ -59,6 +59,7 @@ types: root: optional navbarLinks: optional> footerLinks: optional> + hideNavLinks: optional # logo logoHeight: optional diff --git a/fern/apis/fdr/definition/docs/v1/read/__package__.yml b/fern/apis/fdr/definition/docs/v1/read/__package__.yml index f9ad0af875..b821b56465 100644 --- a/fern/apis/fdr/definition/docs/v1/read/__package__.yml +++ b/fern/apis/fdr/definition/docs/v1/read/__package__.yml @@ -98,6 +98,7 @@ types: root: optional navbarLinks: optional> footerLinks: optional> + hideNavLinks: optional # logo logoHeight: optional diff --git a/fern/apis/fdr/definition/docs/v1/write/__package__.yml b/fern/apis/fdr/definition/docs/v1/write/__package__.yml index a4c0be7e1b..ac4dc96d5c 100644 --- a/fern/apis/fdr/definition/docs/v1/write/__package__.yml +++ b/fern/apis/fdr/definition/docs/v1/write/__package__.yml @@ -93,6 +93,7 @@ types: root: optional navbarLinks: optional> footerLinks: optional> + hideNavLinks: optional # logo logoHeight: optional diff --git a/packages/commons/fdr-utils/src/definition-object-factory.ts b/packages/commons/fdr-utils/src/definition-object-factory.ts index ce483172e6..df80caa232 100644 --- a/packages/commons/fdr-utils/src/definition-object-factory.ts +++ b/packages/commons/fdr-utils/src/definition-object-factory.ts @@ -22,6 +22,7 @@ export class DefinitionObjectFactory { }, navbarLinks: [], navigation: { items: [], landingPage: undefined }, + hideNavLinks: undefined, root: undefined, title: undefined, defaultLanguage: undefined, diff --git a/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/db/types/DocsDbConfig.ts b/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/db/types/DocsDbConfig.ts index 2e9a8caba7..cc284601e4 100644 --- a/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/db/types/DocsDbConfig.ts +++ b/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/db/types/DocsDbConfig.ts @@ -12,6 +12,7 @@ export interface DocsDbConfig { root: FernRegistry.navigation.v1.RootNode | undefined; navbarLinks: FernRegistry.docs.v1.commons.NavbarLink[] | undefined; footerLinks: FernRegistry.docs.v1.commons.FooterLink[] | undefined; + hideNavLinks: boolean | undefined; logoHeight: FernRegistry.docs.v1.read.Height | undefined; logoHref: FernRegistry.Url | undefined; favicon: FernRegistry.FileId | undefined; diff --git a/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/read/types/DocsConfig.ts b/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/read/types/DocsConfig.ts index a549e434ee..177623a6c4 100644 --- a/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/read/types/DocsConfig.ts +++ b/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/read/types/DocsConfig.ts @@ -12,6 +12,7 @@ export interface DocsConfig { root: FernRegistry.navigation.v1.RootNode | undefined; navbarLinks: FernRegistry.docs.v1.commons.NavbarLink[] | undefined; footerLinks: FernRegistry.docs.v1.commons.FooterLink[] | undefined; + hideNavLinks: boolean | undefined; logoHeight: FernRegistry.docs.v1.read.Height | undefined; logoHref: FernRegistry.Url | undefined; favicon: FernRegistry.FileId | undefined; diff --git a/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/write/client/Client.ts b/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/write/client/Client.ts index 272d624b68..9454a536fa 100644 --- a/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/write/client/Client.ts +++ b/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/write/client/Client.ts @@ -205,6 +205,7 @@ export class Write { * "key": "value" * } * }], + * hideNavLinks: true, * logoHeight: 1.1, * logoHref: FernRegistry.Url("string"), * favicon: FernRegistry.FileId("string"), diff --git a/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/write/client/requests/RegisterDocsRequest.ts b/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/write/client/requests/RegisterDocsRequest.ts index dbdc2d136f..9013997412 100644 --- a/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/write/client/requests/RegisterDocsRequest.ts +++ b/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/write/client/requests/RegisterDocsRequest.ts @@ -124,6 +124,7 @@ import * as FernRegistry from "../../../../../../../../index"; * "key": "value" * } * }], + * hideNavLinks: true, * logoHeight: 1.1, * logoHref: FernRegistry.Url("string"), * favicon: FernRegistry.FileId("string"), diff --git a/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/write/types/DocsConfig.ts b/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/write/types/DocsConfig.ts index a5be303dd5..5f809a6c61 100644 --- a/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/write/types/DocsConfig.ts +++ b/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/write/types/DocsConfig.ts @@ -12,6 +12,7 @@ export interface DocsConfig { root: FernRegistry.navigation.v1.RootNode | undefined; navbarLinks: FernRegistry.docs.v1.commons.NavbarLink[] | undefined; footerLinks: FernRegistry.docs.v1.commons.FooterLink[] | undefined; + hideNavLinks: boolean | undefined; logoHeight: FernRegistry.docs.v1.write.Height | undefined; logoHref: FernRegistry.Url | undefined; favicon: FernRegistry.FileId | undefined; diff --git a/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v2/resources/write/client/Client.ts b/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v2/resources/write/client/Client.ts index 6f79369d80..1409a0e827 100644 --- a/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v2/resources/write/client/Client.ts +++ b/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v2/resources/write/client/Client.ts @@ -309,6 +309,7 @@ export class Write { * "key": "value" * } * }], + * hideNavLinks: true, * logoHeight: 1.1, * logoHref: FernRegistry.Url("string"), * favicon: FernRegistry.FileId("string"), diff --git a/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v2/resources/write/client/requests/RegisterDocsRequest.ts b/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v2/resources/write/client/requests/RegisterDocsRequest.ts index dbdc2d136f..9013997412 100644 --- a/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v2/resources/write/client/requests/RegisterDocsRequest.ts +++ b/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v2/resources/write/client/requests/RegisterDocsRequest.ts @@ -124,6 +124,7 @@ import * as FernRegistry from "../../../../../../../../index"; * "key": "value" * } * }], + * hideNavLinks: true, * logoHeight: 1.1, * logoHref: FernRegistry.Url("string"), * favicon: FernRegistry.FileId("string"), diff --git a/packages/fdr-sdk/src/converters/db/convertDocsDefinitionToDb.ts b/packages/fdr-sdk/src/converters/db/convertDocsDefinitionToDb.ts index e9d4b7bd98..3a54f742b0 100644 --- a/packages/fdr-sdk/src/converters/db/convertDocsDefinitionToDb.ts +++ b/packages/fdr-sdk/src/converters/db/convertDocsDefinitionToDb.ts @@ -110,6 +110,7 @@ export function convertDocsDefinitionToDb({ : undefined, navbarLinks: writeShape.config.navbarLinks, footerLinks: writeShape.config.footerLinks, + hideNavLinks: writeShape.config.hideNavLinks, title: writeShape.config.title, favicon: writeShape.config.favicon, backgroundImage: writeShape.config.backgroundImage, diff --git a/packages/fdr-sdk/src/converters/read/convertDbDocsConfigToRead.ts b/packages/fdr-sdk/src/converters/read/convertDbDocsConfigToRead.ts index e3d2903e63..f15ded3b0f 100644 --- a/packages/fdr-sdk/src/converters/read/convertDbDocsConfigToRead.ts +++ b/packages/fdr-sdk/src/converters/read/convertDbDocsConfigToRead.ts @@ -29,6 +29,7 @@ export function convertDbDocsConfigToRead({ colorsV3: dbShape.colorsV3 ?? getColorsV3(dbShape), navbarLinks: dbShape.navbarLinks, footerLinks: dbShape.footerLinks, + hideNavLinks: dbShape.hideNavLinks, title: dbShape.title, favicon: dbShape.favicon, typographyV2: diff --git a/packages/parsers/src/client/generated/api/resources/docs/resources/v1/resources/db/types/DocsDbConfig.ts b/packages/parsers/src/client/generated/api/resources/docs/resources/v1/resources/db/types/DocsDbConfig.ts index 2e9a8caba7..cc284601e4 100644 --- a/packages/parsers/src/client/generated/api/resources/docs/resources/v1/resources/db/types/DocsDbConfig.ts +++ b/packages/parsers/src/client/generated/api/resources/docs/resources/v1/resources/db/types/DocsDbConfig.ts @@ -12,6 +12,7 @@ export interface DocsDbConfig { root: FernRegistry.navigation.v1.RootNode | undefined; navbarLinks: FernRegistry.docs.v1.commons.NavbarLink[] | undefined; footerLinks: FernRegistry.docs.v1.commons.FooterLink[] | undefined; + hideNavLinks: boolean | undefined; logoHeight: FernRegistry.docs.v1.read.Height | undefined; logoHref: FernRegistry.Url | undefined; favicon: FernRegistry.FileId | undefined; diff --git a/packages/parsers/src/client/generated/api/resources/docs/resources/v1/resources/read/types/DocsConfig.ts b/packages/parsers/src/client/generated/api/resources/docs/resources/v1/resources/read/types/DocsConfig.ts index a549e434ee..177623a6c4 100644 --- a/packages/parsers/src/client/generated/api/resources/docs/resources/v1/resources/read/types/DocsConfig.ts +++ b/packages/parsers/src/client/generated/api/resources/docs/resources/v1/resources/read/types/DocsConfig.ts @@ -12,6 +12,7 @@ export interface DocsConfig { root: FernRegistry.navigation.v1.RootNode | undefined; navbarLinks: FernRegistry.docs.v1.commons.NavbarLink[] | undefined; footerLinks: FernRegistry.docs.v1.commons.FooterLink[] | undefined; + hideNavLinks: boolean | undefined; logoHeight: FernRegistry.docs.v1.read.Height | undefined; logoHref: FernRegistry.Url | undefined; favicon: FernRegistry.FileId | undefined; diff --git a/packages/parsers/src/client/generated/api/resources/docs/resources/v1/resources/write/types/DocsConfig.ts b/packages/parsers/src/client/generated/api/resources/docs/resources/v1/resources/write/types/DocsConfig.ts index a5be303dd5..5f809a6c61 100644 --- a/packages/parsers/src/client/generated/api/resources/docs/resources/v1/resources/write/types/DocsConfig.ts +++ b/packages/parsers/src/client/generated/api/resources/docs/resources/v1/resources/write/types/DocsConfig.ts @@ -12,6 +12,7 @@ export interface DocsConfig { root: FernRegistry.navigation.v1.RootNode | undefined; navbarLinks: FernRegistry.docs.v1.commons.NavbarLink[] | undefined; footerLinks: FernRegistry.docs.v1.commons.FooterLink[] | undefined; + hideNavLinks: boolean | undefined; logoHeight: FernRegistry.docs.v1.write.Height | undefined; logoHref: FernRegistry.Url | undefined; favicon: FernRegistry.FileId | undefined; diff --git a/servers/fdr/src/api/generated/api/resources/docs/resources/v1/resources/db/types/DocsDbConfig.d.ts b/servers/fdr/src/api/generated/api/resources/docs/resources/v1/resources/db/types/DocsDbConfig.d.ts index 59589e48ea..6a168346a0 100644 --- a/servers/fdr/src/api/generated/api/resources/docs/resources/v1/resources/db/types/DocsDbConfig.d.ts +++ b/servers/fdr/src/api/generated/api/resources/docs/resources/v1/resources/db/types/DocsDbConfig.d.ts @@ -10,6 +10,7 @@ export interface DocsDbConfig { root: FernRegistry.navigation.v1.RootNode | undefined; navbarLinks: FernRegistry.docs.v1.commons.NavbarLink[] | undefined; footerLinks: FernRegistry.docs.v1.commons.FooterLink[] | undefined; + hideNavLinks: boolean | undefined; logoHeight: FernRegistry.docs.v1.read.Height | undefined; logoHref: FernRegistry.Url | undefined; favicon: FernRegistry.FileId | undefined; diff --git a/servers/fdr/src/api/generated/api/resources/docs/resources/v1/resources/read/types/DocsConfig.d.ts b/servers/fdr/src/api/generated/api/resources/docs/resources/v1/resources/read/types/DocsConfig.d.ts index 19f2c6d9f5..adc8fee05a 100644 --- a/servers/fdr/src/api/generated/api/resources/docs/resources/v1/resources/read/types/DocsConfig.d.ts +++ b/servers/fdr/src/api/generated/api/resources/docs/resources/v1/resources/read/types/DocsConfig.d.ts @@ -10,6 +10,7 @@ export interface DocsConfig { root: FernRegistry.navigation.v1.RootNode | undefined; navbarLinks: FernRegistry.docs.v1.commons.NavbarLink[] | undefined; footerLinks: FernRegistry.docs.v1.commons.FooterLink[] | undefined; + hideNavLinks: boolean | undefined; logoHeight: FernRegistry.docs.v1.read.Height | undefined; logoHref: FernRegistry.Url | undefined; favicon: FernRegistry.FileId | undefined; diff --git a/servers/fdr/src/api/generated/api/resources/docs/resources/v1/resources/write/types/DocsConfig.d.ts b/servers/fdr/src/api/generated/api/resources/docs/resources/v1/resources/write/types/DocsConfig.d.ts index 2c9f10b49f..d31aafbb65 100644 --- a/servers/fdr/src/api/generated/api/resources/docs/resources/v1/resources/write/types/DocsConfig.d.ts +++ b/servers/fdr/src/api/generated/api/resources/docs/resources/v1/resources/write/types/DocsConfig.d.ts @@ -10,6 +10,7 @@ export interface DocsConfig { root: FernRegistry.navigation.v1.RootNode | undefined; navbarLinks: FernRegistry.docs.v1.commons.NavbarLink[] | undefined; footerLinks: FernRegistry.docs.v1.commons.FooterLink[] | undefined; + hideNavLinks: boolean | undefined; logoHeight: FernRegistry.docs.v1.write.Height | undefined; logoHref: FernRegistry.Url | undefined; favicon: FernRegistry.FileId | undefined; diff --git a/servers/fdr/src/healthchecks/checkRedis.ts b/servers/fdr/src/healthchecks/checkRedis.ts index 120c93b066..4a8b4dc73f 100644 --- a/servers/fdr/src/healthchecks/checkRedis.ts +++ b/servers/fdr/src/healthchecks/checkRedis.ts @@ -28,6 +28,7 @@ const HEALTHCHECK_DOCS_RESPONSE: CachedDocsResponse = { announcement: undefined, navbarLinks: undefined, footerLinks: undefined, + hideNavLinks: undefined, logoHeight: undefined, logoHref: undefined, favicon: undefined, From 54d214ca702245ce14aae7f66137f5cbb4366f63 Mon Sep 17 00:00:00 2001 From: Darwin Ding Date: Mon, 13 Jan 2025 17:12:01 -0500 Subject: [PATCH 3/6] Using NEXT_PUBLIC_VERCEL_ENV to determine whether to reroute chat/suggest endpoints (#1986) --- packages/fern-docs/ui/src/search/SearchV2.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/fern-docs/ui/src/search/SearchV2.tsx b/packages/fern-docs/ui/src/search/SearchV2.tsx index 97a02e484d..afb20f928c 100644 --- a/packages/fern-docs/ui/src/search/SearchV2.tsx +++ b/packages/fern-docs/ui/src/search/SearchV2.tsx @@ -91,7 +91,7 @@ export function SearchV2(): ReactElement | false { // Rerouting to ferndocs.com for production environments to ensure streaming works // Also see: next.config.mjs, where we set CORS headers - if (process.env.NODE_ENV === "production") { + if (process.env.NEXT_PUBLIC_VERCEL_ENV === "production") { chatEndpoint = `https://app.ferndocs.com/api/fern-docs/search/v2/chat`; suggestEndpoint = `https://app.ferndocs.com/api/fern-docs/search/v2/suggest`; } From f39bf28ddfad9d997fe9f909b4b5b09dc4fd30fd Mon Sep 17 00:00:00 2001 From: Deep Singhvi Date: Mon, 13 Jan 2025 17:13:10 -0500 Subject: [PATCH 4/6] fix(ai): only index nodes with unique canonical slugs (#1991) --- .../fdr-sdk/src/navigation/NodeCollector.ts | 25 ++++++++++++++++++- .../records/create-turbopuffer-records.ts | 8 +----- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/packages/fdr-sdk/src/navigation/NodeCollector.ts b/packages/fdr-sdk/src/navigation/NodeCollector.ts index b871ee2d83..b99a33f4aa 100644 --- a/packages/fdr-sdk/src/navigation/NodeCollector.ts +++ b/packages/fdr-sdk/src/navigation/NodeCollector.ts @@ -2,6 +2,7 @@ import { EMPTY_ARRAY } from "@fern-api/ui-core-utils"; import { once } from "es-toolkit/function"; import { FernNavigation } from "./.."; import { pruneVersionNode } from "./utils/pruneVersionNode"; +import { NavigationNodeWithMetadata } from "./versions"; interface NavigationNodeWithMetadataAndParents { node: FernNavigation.NavigationNodeWithMetadata; @@ -134,7 +135,6 @@ export class NodeCollector { this.#setNode(node.slug, node, parents); } else { if (FernNavigation.isPage(existing.node)) { - // eslint-disable-next-line no-console console.warn(`Duplicate slug found: ${node.slug}`, node.title); } this.orphanedNodes.push(node); @@ -236,6 +236,29 @@ export class NodeCollector { return this.#getIndexablePageSlugs(); } + #getIndexablePageNodesWithAuth = once((): NavigationNodeWithMetadata[] => { + const slugRecord: Record = {}; + + [...this.slugToNode.values()] + .filter(({ node }) => FernNavigation.isPage(node)) + .filter(({ node }) => !node.hidden) + .filter(({ node }) => + FernNavigation.hasMarkdown(node) ? !node.noindex : true + ) + .forEach((node) => { + const canonicalSlug = node.node.canonicalSlug ?? node.node.slug; + // Only keep the first node we see for each canonical slug + if (!(canonicalSlug in slugRecord)) { + slugRecord[canonicalSlug] = node.node; + } + }); + + return Object.values(slugRecord); + }); + get indexablePageNodesWithAuth(): NavigationNodeWithMetadata[] { + return this.#getIndexablePageNodesWithAuth(); + } + public getVersionNodes = (): FernNavigation.VersionNode[] => { return this.versionNodes; }; diff --git a/packages/fern-docs/search-server/src/turbopuffer/records/create-turbopuffer-records.ts b/packages/fern-docs/search-server/src/turbopuffer/records/create-turbopuffer-records.ts index eb084dd8b0..d5376fc0c8 100644 --- a/packages/fern-docs/search-server/src/turbopuffer/records/create-turbopuffer-records.ts +++ b/packages/fern-docs/search-server/src/turbopuffer/records/create-turbopuffer-records.ts @@ -5,7 +5,6 @@ import { RootNode, getPageId, hasMarkdown, - isPage, } from "@fern-api/fdr-sdk/navigation"; import { flatten } from "es-toolkit/array"; import { FernTurbopufferRecordWithoutVector } from "../types"; @@ -35,12 +34,7 @@ export async function createTurbopufferRecords({ > { const collector = NodeCollector.collect(root); - const pageNodes = Array.from(collector.slugMap.values()) - .filter(isPage) - // exclude hidden pages - .filter((node) => node.hidden !== true) - // exclude pages that are noindexed - .filter((node) => (hasMarkdown(node) ? node.noindex !== true : true)); + const pageNodes = collector.indexablePageNodesWithAuth; const markdownNodes = pageNodes.filter(hasMarkdown); // const apiLeafNodes = pageNodes.filter(isApiLeaf); From 3e7642c7b9a7e98f063c3780acf1af23e6dc8170 Mon Sep 17 00:00:00 2001 From: Deep Singhvi Date: Mon, 13 Jan 2025 17:44:12 -0500 Subject: [PATCH 5/6] feat(openrpc): parse component schemas (#2001) --- ...HeaderSecuritySchemeConverter.node.test.ts | 2 +- ...OAuth2SecuritySchemeConverter.node.test.ts | 2 +- ...ityRequirementObjectConverter.node.test.ts | 2 +- .../SecuritySchemeConverter.node.test.ts | 2 +- .../AvailabilityConverter.node.test.ts | 2 +- .../XFernBasePathConverter.node.test.ts | 2 +- ...XFernEndpointExampleConverter.node.test.ts | 2 +- .../XFernGroupNameConverter.node.test.ts | 2 +- .../XFernSdkMethodNameConverter.node.test.ts | 4 +- .../XFernServerNameConverter.node.test.ts | 4 +- ...rnAccessTokenLocatorConverter.node.test.ts | 2 +- .../__test__/auth/XFernBasicAuth.node.test.ts | 2 +- ...PasswordVariableNameConverter.node.test.ts | 2 +- ...UsernameVariableNameConverter.node.test.ts | 2 +- .../XFernBearerFormatConverter.node.test.ts | 2 +- .../XFernBearerTokenConverter.node.test.ts | 2 +- ...rerTokenVariableNameConverter.node.test.ts | 2 +- .../XFernHeaderAuthConverter.node.test.ts | 2 +- ...rnHeaderVariableNameConverter.node.test.ts | 2 +- .../RedocExampleConverter.node.test.ts | 2 +- .../ExampleObjectConverter.node.test.ts | 2 +- .../OperationObjectConverter.node.test.ts | 2 +- .../PathItemObjectConverter.node.test.ts | 2 +- .../PathsObjectConverter.node.test.ts | 2 +- .../ServerObjectConverter.node.test.ts | 2 +- .../__test__/TagsObjectConverter.node.test.ts | 2 +- .../ParameterBaseObjectConverter.node.test.ts | 2 +- .../ExampleObjectConverter.node.test.ts | 2 +- ...rmDataPropertySchemaConverter.node.test.ts | 2 +- .../RequestBodyObjectConverter.node.test.ts | 2 +- ...questMediaTypeObjectConverter.node.test.ts | 2 +- ...ponseMediaTypeObjectConverter.node.test.ts | 2 +- .../ResponseObjectConverter.node.test.ts | 2 +- .../ResponsesObjectConverter.node.test.ts | 2 +- .../3.1/schemas/ComponentsConverter.node.ts | 7 +- .../__test__/ArrayConverter.node.test.ts | 2 +- .../__test__/ComponentsConverter.node.test.ts | 2 +- .../__test__/ConstConverterNode.test.ts | 2 +- .../MixedSchemaConverter.node.test.ts | 2 +- .../__test__/ObjectConverter.node.test.ts | 2 +- .../__test__/OneOfConverter.node.test.ts | 2 +- .../__test__/ReferenceConverter.node.test.ts | 2 +- .../__test__/SchemaConverter.node.test.ts | 2 +- .../__test__/BooleanConverter.node.test.ts | 2 +- .../__test__/EnumConverter.node.test.ts | 2 +- .../__test__/IntegerConverter.node.test.ts | 2 +- .../__test__/NullConverter.node.test.ts | 2 +- .../__test__/NumberConverter.node.test.ts | 2 +- .../__test__/StringConverter.node.test.ts | 2 +- .../OpenApiDocumentConverterNode.test.ts} | 8 +- .../__test__/__snapshots__}/cohere.json | 0 .../__test__/__snapshots__}/deeptune.json | 0 .../__test__/__snapshots__}/petstore.json | 0 .../__test__/__snapshots__}/uploadcare.json | 0 .../__test__/createMockContext.util.ts | 2 +- .../__test__/fixtures/cohere/openapi.yml | 0 .../__test__/fixtures/deeptune/openapi.yml | 0 .../__test__/fixtures/petstore/openapi.yml | 0 .../__test__/fixtures/uploadcare/openapi.yml | 0 .../__test__/3.1/coalesceServers.test.ts | 2 +- .../3.1/convertToObjectProperties.test.ts | 2 +- .../1.x/OpenrpcDocumentConverter.node.ts | 49 +++++ ...r.node.ts => BaseOpenrpcConverter.node.ts} | 20 +- .../openrpc/__test__/OpenrpcConverter.test.ts | 61 ++++++ .../__test__/__snapshots__/petstore.json | 89 ++++++++ .../__test__/createMockContext.util.ts | 33 +++ .../__test__/fixtures/petstore/openrpc.json | 204 ++++++++++++++++++ packages/parsers/src/openrpc/index.ts | 2 +- 68 files changed, 508 insertions(+), 71 deletions(-) rename packages/parsers/src/{__test__/createSnapshots.test.ts => openapi/__test__/OpenApiDocumentConverterNode.test.ts} (87%) rename packages/parsers/src/{__test__/__snapshots__/openapi => openapi/__test__/__snapshots__}/cohere.json (100%) rename packages/parsers/src/{__test__/__snapshots__/openapi => openapi/__test__/__snapshots__}/deeptune.json (100%) rename packages/parsers/src/{__test__/__snapshots__/openapi => openapi/__test__/__snapshots__}/petstore.json (100%) rename packages/parsers/src/{__test__/__snapshots__/openapi => openapi/__test__/__snapshots__}/uploadcare.json (100%) rename packages/parsers/src/{ => openapi}/__test__/createMockContext.util.ts (83%) rename packages/parsers/src/{ => openapi}/__test__/fixtures/cohere/openapi.yml (100%) rename packages/parsers/src/{ => openapi}/__test__/fixtures/deeptune/openapi.yml (100%) rename packages/parsers/src/{ => openapi}/__test__/fixtures/petstore/openapi.yml (100%) rename packages/parsers/src/{ => openapi}/__test__/fixtures/uploadcare/openapi.yml (100%) create mode 100644 packages/parsers/src/openrpc/1.x/OpenrpcDocumentConverter.node.ts rename packages/parsers/src/openrpc/{BaseOpenApiV3_1Converter.node.ts => BaseOpenrpcConverter.node.ts} (65%) create mode 100644 packages/parsers/src/openrpc/__test__/OpenrpcConverter.test.ts create mode 100644 packages/parsers/src/openrpc/__test__/__snapshots__/petstore.json create mode 100644 packages/parsers/src/openrpc/__test__/createMockContext.util.ts create mode 100644 packages/parsers/src/openrpc/__test__/fixtures/petstore/openrpc.json diff --git a/packages/parsers/src/openapi/3.1/auth/__test__/HeaderSecuritySchemeConverter.node.test.ts b/packages/parsers/src/openapi/3.1/auth/__test__/HeaderSecuritySchemeConverter.node.test.ts index a2de37f950..a3dec931cd 100644 --- a/packages/parsers/src/openapi/3.1/auth/__test__/HeaderSecuritySchemeConverter.node.test.ts +++ b/packages/parsers/src/openapi/3.1/auth/__test__/HeaderSecuritySchemeConverter.node.test.ts @@ -1,4 +1,4 @@ -import { createMockContext } from "../../../../__test__/createMockContext.util"; +import { createMockContext } from "../../../__test__/createMockContext.util"; import { HeaderSecuritySchemeConverterNode } from "../HeaderSecuritySchemeConverter.node"; describe("HeaderSecuritySchemeConverterNode", () => { diff --git a/packages/parsers/src/openapi/3.1/auth/__test__/OAuth2SecuritySchemeConverter.node.test.ts b/packages/parsers/src/openapi/3.1/auth/__test__/OAuth2SecuritySchemeConverter.node.test.ts index bd57de9b44..c9fc12e03d 100644 --- a/packages/parsers/src/openapi/3.1/auth/__test__/OAuth2SecuritySchemeConverter.node.test.ts +++ b/packages/parsers/src/openapi/3.1/auth/__test__/OAuth2SecuritySchemeConverter.node.test.ts @@ -1,5 +1,5 @@ import { OpenAPIV3_1 } from "openapi-types"; -import { createMockContext } from "../../../../__test__/createMockContext.util"; +import { createMockContext } from "../../../__test__/createMockContext.util"; import { OAuth2SecuritySchemeConverterNode } from "../OAuth2SecuritySchemeConverter.node"; describe("OAuth2SecuritySchemeConverterNode", () => { diff --git a/packages/parsers/src/openapi/3.1/auth/__test__/SecurityRequirementObjectConverter.node.test.ts b/packages/parsers/src/openapi/3.1/auth/__test__/SecurityRequirementObjectConverter.node.test.ts index d896e2e78c..2c3c352d4a 100644 --- a/packages/parsers/src/openapi/3.1/auth/__test__/SecurityRequirementObjectConverter.node.test.ts +++ b/packages/parsers/src/openapi/3.1/auth/__test__/SecurityRequirementObjectConverter.node.test.ts @@ -1,5 +1,5 @@ import { OpenAPIV3_1 } from "openapi-types"; -import { createMockContext } from "../../../../__test__/createMockContext.util"; +import { createMockContext } from "../../../__test__/createMockContext.util"; import { SecurityRequirementObjectConverterNode } from "../SecurityRequirementObjectConverter.node"; describe("SecurityRequirementObjectConverterNode", () => { diff --git a/packages/parsers/src/openapi/3.1/auth/__test__/SecuritySchemeConverter.node.test.ts b/packages/parsers/src/openapi/3.1/auth/__test__/SecuritySchemeConverter.node.test.ts index 4773d2d8c4..477a111a90 100644 --- a/packages/parsers/src/openapi/3.1/auth/__test__/SecuritySchemeConverter.node.test.ts +++ b/packages/parsers/src/openapi/3.1/auth/__test__/SecuritySchemeConverter.node.test.ts @@ -1,5 +1,5 @@ import { OpenAPIV3_1 } from "openapi-types"; -import { createMockContext } from "../../../../__test__/createMockContext.util"; +import { createMockContext } from "../../../__test__/createMockContext.util"; import { SecuritySchemeConverterNode } from "../SecuritySchemeConverter.node"; describe("SecuritySchemeConverterNode", () => { diff --git a/packages/parsers/src/openapi/3.1/extensions/__test__/AvailabilityConverter.node.test.ts b/packages/parsers/src/openapi/3.1/extensions/__test__/AvailabilityConverter.node.test.ts index 589ec3ae59..6def20bd39 100644 --- a/packages/parsers/src/openapi/3.1/extensions/__test__/AvailabilityConverter.node.test.ts +++ b/packages/parsers/src/openapi/3.1/extensions/__test__/AvailabilityConverter.node.test.ts @@ -1,6 +1,6 @@ import { OpenAPIV3_1 } from "openapi-types"; -import { createMockContext } from "../../../../__test__/createMockContext.util"; import { FernRegistry } from "../../../../client/generated"; +import { createMockContext } from "../../../__test__/createMockContext.util"; import { Availability, AvailabilityConverterNode, diff --git a/packages/parsers/src/openapi/3.1/extensions/__test__/XFernBasePathConverter.node.test.ts b/packages/parsers/src/openapi/3.1/extensions/__test__/XFernBasePathConverter.node.test.ts index 13450c6115..565cf4651f 100644 --- a/packages/parsers/src/openapi/3.1/extensions/__test__/XFernBasePathConverter.node.test.ts +++ b/packages/parsers/src/openapi/3.1/extensions/__test__/XFernBasePathConverter.node.test.ts @@ -1,5 +1,5 @@ import { OpenAPIV3_1 } from "openapi-types"; -import { createMockContext } from "../../../../__test__/createMockContext.util"; +import { createMockContext } from "../../../__test__/createMockContext.util"; import { XFernBasePathConverterNode } from "../XFernBasePathConverter.node"; import { X_FERN_BASE_PATH } from "../fernExtension.consts"; diff --git a/packages/parsers/src/openapi/3.1/extensions/__test__/XFernEndpointExampleConverter.node.test.ts b/packages/parsers/src/openapi/3.1/extensions/__test__/XFernEndpointExampleConverter.node.test.ts index 830754b2c9..fdfc0ad6ec 100644 --- a/packages/parsers/src/openapi/3.1/extensions/__test__/XFernEndpointExampleConverter.node.test.ts +++ b/packages/parsers/src/openapi/3.1/extensions/__test__/XFernEndpointExampleConverter.node.test.ts @@ -1,5 +1,5 @@ -import { createMockContext } from "../../../../__test__/createMockContext.util"; import { FernRegistry } from "../../../../client/generated"; +import { createMockContext } from "../../../__test__/createMockContext.util"; import { BaseOpenApiV3_1ConverterNodeConstructorArgs } from "../../../BaseOpenApiV3_1Converter.node"; import { RequestMediaTypeObjectConverterNode, diff --git a/packages/parsers/src/openapi/3.1/extensions/__test__/XFernGroupNameConverter.node.test.ts b/packages/parsers/src/openapi/3.1/extensions/__test__/XFernGroupNameConverter.node.test.ts index 1887fe6e46..16229a6f2f 100644 --- a/packages/parsers/src/openapi/3.1/extensions/__test__/XFernGroupNameConverter.node.test.ts +++ b/packages/parsers/src/openapi/3.1/extensions/__test__/XFernGroupNameConverter.node.test.ts @@ -1,4 +1,4 @@ -import { createMockContext } from "../../../../__test__/createMockContext.util"; +import { createMockContext } from "../../../__test__/createMockContext.util"; import { XFernGroupNameConverterNode } from "../XFernGroupNameConverter.node"; describe("XFernGroupNameConverterNode", () => { diff --git a/packages/parsers/src/openapi/3.1/extensions/__test__/XFernSdkMethodNameConverter.node.test.ts b/packages/parsers/src/openapi/3.1/extensions/__test__/XFernSdkMethodNameConverter.node.test.ts index 54344c4378..0655f5c770 100644 --- a/packages/parsers/src/openapi/3.1/extensions/__test__/XFernSdkMethodNameConverter.node.test.ts +++ b/packages/parsers/src/openapi/3.1/extensions/__test__/XFernSdkMethodNameConverter.node.test.ts @@ -1,7 +1,7 @@ -import { createMockContext } from "../../../../__test__/createMockContext.util"; +import { createMockContext } from "../../../__test__/createMockContext.util"; import { BaseOpenApiV3_1ConverterNodeConstructorArgs } from "../../../BaseOpenApiV3_1Converter.node"; -import { XFernSdkMethodNameConverterNode } from "../XFernSdkMethodNameConverter.node"; import { X_FERN_SDK_METHOD_NAME } from "../fernExtension.consts"; +import { XFernSdkMethodNameConverterNode } from "../XFernSdkMethodNameConverter.node"; describe("XFernSdkMethodNameConverterNode", () => { const mockContext = createMockContext(); diff --git a/packages/parsers/src/openapi/3.1/extensions/__test__/XFernServerNameConverter.node.test.ts b/packages/parsers/src/openapi/3.1/extensions/__test__/XFernServerNameConverter.node.test.ts index 57b81a3471..b6d6d4373a 100644 --- a/packages/parsers/src/openapi/3.1/extensions/__test__/XFernServerNameConverter.node.test.ts +++ b/packages/parsers/src/openapi/3.1/extensions/__test__/XFernServerNameConverter.node.test.ts @@ -1,7 +1,7 @@ -import { createMockContext } from "../../../../__test__/createMockContext.util"; +import { createMockContext } from "../../../__test__/createMockContext.util"; import { BaseOpenApiV3_1ConverterNodeConstructorArgs } from "../../../BaseOpenApiV3_1Converter.node"; -import { XFernServerNameConverterNode } from "../XFernServerNameConverter.node"; import { X_FERN_SERVER_NAME } from "../fernExtension.consts"; +import { XFernServerNameConverterNode } from "../XFernServerNameConverter.node"; describe("XFernServerNameConverterNode", () => { const mockContext = createMockContext(); diff --git a/packages/parsers/src/openapi/3.1/extensions/__test__/auth/XFernAccessTokenLocatorConverter.node.test.ts b/packages/parsers/src/openapi/3.1/extensions/__test__/auth/XFernAccessTokenLocatorConverter.node.test.ts index aed9351dd7..d3848b78fb 100644 --- a/packages/parsers/src/openapi/3.1/extensions/__test__/auth/XFernAccessTokenLocatorConverter.node.test.ts +++ b/packages/parsers/src/openapi/3.1/extensions/__test__/auth/XFernAccessTokenLocatorConverter.node.test.ts @@ -1,4 +1,4 @@ -import { createMockContext } from "../../../../../__test__/createMockContext.util"; +import { createMockContext } from "../../../../__test__/createMockContext.util"; import { XFernAccessTokenLocatorConverterNode } from "../../auth/XFernAccessTokenLocatorConverter.node"; describe("XFernAccessTokenLocatorConverterNode", () => { diff --git a/packages/parsers/src/openapi/3.1/extensions/__test__/auth/XFernBasicAuth.node.test.ts b/packages/parsers/src/openapi/3.1/extensions/__test__/auth/XFernBasicAuth.node.test.ts index 9e818462bd..943e9ebc85 100644 --- a/packages/parsers/src/openapi/3.1/extensions/__test__/auth/XFernBasicAuth.node.test.ts +++ b/packages/parsers/src/openapi/3.1/extensions/__test__/auth/XFernBasicAuth.node.test.ts @@ -1,4 +1,4 @@ -import { createMockContext } from "../../../../../__test__/createMockContext.util"; +import { createMockContext } from "../../../../__test__/createMockContext.util"; import { XFernBasicAuthNode } from "../../auth/XFernBasicAuth.node"; import { TokenSecurityScheme } from "../../auth/types/TokenSecurityScheme"; diff --git a/packages/parsers/src/openapi/3.1/extensions/__test__/auth/XFernBasicPasswordVariableNameConverter.node.test.ts b/packages/parsers/src/openapi/3.1/extensions/__test__/auth/XFernBasicPasswordVariableNameConverter.node.test.ts index e5468b2755..e8055649bf 100644 --- a/packages/parsers/src/openapi/3.1/extensions/__test__/auth/XFernBasicPasswordVariableNameConverter.node.test.ts +++ b/packages/parsers/src/openapi/3.1/extensions/__test__/auth/XFernBasicPasswordVariableNameConverter.node.test.ts @@ -1,4 +1,4 @@ -import { createMockContext } from "../../../../../__test__/createMockContext.util"; +import { createMockContext } from "../../../../__test__/createMockContext.util"; import { XFernBasicPasswordVariableNameConverterNode } from "../../auth/XFernBasicPasswordVariableNameConverter.node"; describe("XFernBasicPasswordVariableNameConverterNode", () => { diff --git a/packages/parsers/src/openapi/3.1/extensions/__test__/auth/XFernBasicUsernameVariableNameConverter.node.test.ts b/packages/parsers/src/openapi/3.1/extensions/__test__/auth/XFernBasicUsernameVariableNameConverter.node.test.ts index 02b6e3bc48..8f8ab7bedb 100644 --- a/packages/parsers/src/openapi/3.1/extensions/__test__/auth/XFernBasicUsernameVariableNameConverter.node.test.ts +++ b/packages/parsers/src/openapi/3.1/extensions/__test__/auth/XFernBasicUsernameVariableNameConverter.node.test.ts @@ -1,4 +1,4 @@ -import { createMockContext } from "../../../../../__test__/createMockContext.util"; +import { createMockContext } from "../../../../__test__/createMockContext.util"; import { XFernBasicUsernameVariableNameConverterNode } from "../../auth/XFernBasicUsernameVariableNameConverter.node"; describe("XFernBasicUsernameVariableNameConverterNode", () => { diff --git a/packages/parsers/src/openapi/3.1/extensions/__test__/auth/XFernBearerFormatConverter.node.test.ts b/packages/parsers/src/openapi/3.1/extensions/__test__/auth/XFernBearerFormatConverter.node.test.ts index 75a56c2bf5..a0e2a1f332 100644 --- a/packages/parsers/src/openapi/3.1/extensions/__test__/auth/XFernBearerFormatConverter.node.test.ts +++ b/packages/parsers/src/openapi/3.1/extensions/__test__/auth/XFernBearerFormatConverter.node.test.ts @@ -1,4 +1,4 @@ -import { createMockContext } from "../../../../../__test__/createMockContext.util"; +import { createMockContext } from "../../../../__test__/createMockContext.util"; import { XBearerFormatConverterNode } from "../../auth/XBearerFormatConverter.node"; describe("XBearerFormatConverterNode", () => { diff --git a/packages/parsers/src/openapi/3.1/extensions/__test__/auth/XFernBearerTokenConverter.node.test.ts b/packages/parsers/src/openapi/3.1/extensions/__test__/auth/XFernBearerTokenConverter.node.test.ts index a120f2c5ab..67e02cb07c 100644 --- a/packages/parsers/src/openapi/3.1/extensions/__test__/auth/XFernBearerTokenConverter.node.test.ts +++ b/packages/parsers/src/openapi/3.1/extensions/__test__/auth/XFernBearerTokenConverter.node.test.ts @@ -1,4 +1,4 @@ -import { createMockContext } from "../../../../../__test__/createMockContext.util"; +import { createMockContext } from "../../../../__test__/createMockContext.util"; import { XFernBearerTokenConverterNode } from "../../auth/XFernBearerTokenConverter.node"; import { TokenSecurityScheme } from "../../auth/types/TokenSecurityScheme"; diff --git a/packages/parsers/src/openapi/3.1/extensions/__test__/auth/XFernBearerTokenVariableNameConverter.node.test.ts b/packages/parsers/src/openapi/3.1/extensions/__test__/auth/XFernBearerTokenVariableNameConverter.node.test.ts index 152e43c3b4..13de37ec0e 100644 --- a/packages/parsers/src/openapi/3.1/extensions/__test__/auth/XFernBearerTokenVariableNameConverter.node.test.ts +++ b/packages/parsers/src/openapi/3.1/extensions/__test__/auth/XFernBearerTokenVariableNameConverter.node.test.ts @@ -1,4 +1,4 @@ -import { createMockContext } from "../../../../../__test__/createMockContext.util"; +import { createMockContext } from "../../../../__test__/createMockContext.util"; import { XFernBearerTokenVariableNameConverterNode } from "../../auth/XFernBearerTokenVariableNameConverter.node"; describe("XFernBearerTokenVariableNameConverterNode", () => { diff --git a/packages/parsers/src/openapi/3.1/extensions/__test__/auth/XFernHeaderAuthConverter.node.test.ts b/packages/parsers/src/openapi/3.1/extensions/__test__/auth/XFernHeaderAuthConverter.node.test.ts index 3b9a1d7049..784742e0a3 100644 --- a/packages/parsers/src/openapi/3.1/extensions/__test__/auth/XFernHeaderAuthConverter.node.test.ts +++ b/packages/parsers/src/openapi/3.1/extensions/__test__/auth/XFernHeaderAuthConverter.node.test.ts @@ -1,4 +1,4 @@ -import { createMockContext } from "../../../../../__test__/createMockContext.util"; +import { createMockContext } from "../../../../__test__/createMockContext.util"; import { XFernHeaderAuthConverterNode } from "../../auth/XFernHeaderAuthConverter.node"; import { HeaderTokenSecurityScheme } from "../../auth/types/TokenSecurityScheme"; diff --git a/packages/parsers/src/openapi/3.1/extensions/__test__/auth/XFernHeaderVariableNameConverter.node.test.ts b/packages/parsers/src/openapi/3.1/extensions/__test__/auth/XFernHeaderVariableNameConverter.node.test.ts index 69d87a5b77..b33b8954a3 100644 --- a/packages/parsers/src/openapi/3.1/extensions/__test__/auth/XFernHeaderVariableNameConverter.node.test.ts +++ b/packages/parsers/src/openapi/3.1/extensions/__test__/auth/XFernHeaderVariableNameConverter.node.test.ts @@ -1,4 +1,4 @@ -import { createMockContext } from "../../../../../__test__/createMockContext.util"; +import { createMockContext } from "../../../../__test__/createMockContext.util"; import { XFernHeaderVariableNameConverterNode } from "../../auth/XFernHeaderVariableNameConverter.node"; describe("XFernHeaderVariableNameConverterNode", () => { diff --git a/packages/parsers/src/openapi/3.1/extensions/__test__/examples/RedocExampleConverter.node.test.ts b/packages/parsers/src/openapi/3.1/extensions/__test__/examples/RedocExampleConverter.node.test.ts index 6eb6627ace..dfe01e1328 100644 --- a/packages/parsers/src/openapi/3.1/extensions/__test__/examples/RedocExampleConverter.node.test.ts +++ b/packages/parsers/src/openapi/3.1/extensions/__test__/examples/RedocExampleConverter.node.test.ts @@ -1,4 +1,4 @@ -import { createMockContext } from "../../../../../__test__/createMockContext.util"; +import { createMockContext } from "../../../../__test__/createMockContext.util"; import { BaseOpenApiV3_1ConverterNodeConstructorArgs } from "../../../../BaseOpenApiV3_1Converter.node"; import { RedocExampleConverterNode } from "../../examples/RedocExampleConverter.node"; import { diff --git a/packages/parsers/src/openapi/3.1/paths/__test__/ExampleObjectConverter.node.test.ts b/packages/parsers/src/openapi/3.1/paths/__test__/ExampleObjectConverter.node.test.ts index b50376d0fd..6ddf6465db 100644 --- a/packages/parsers/src/openapi/3.1/paths/__test__/ExampleObjectConverter.node.test.ts +++ b/packages/parsers/src/openapi/3.1/paths/__test__/ExampleObjectConverter.node.test.ts @@ -1,4 +1,4 @@ -import { createMockContext } from "../../../../__test__/createMockContext.util"; +import { createMockContext } from "../../../__test__/createMockContext.util"; import { ExampleObjectConverterNode } from "../ExampleObjectConverter.node"; import { RequestMediaTypeObjectConverterNode } from "../request/RequestMediaTypeObjectConverter.node"; diff --git a/packages/parsers/src/openapi/3.1/paths/__test__/OperationObjectConverter.node.test.ts b/packages/parsers/src/openapi/3.1/paths/__test__/OperationObjectConverter.node.test.ts index a8b992e20d..413e46820d 100644 --- a/packages/parsers/src/openapi/3.1/paths/__test__/OperationObjectConverter.node.test.ts +++ b/packages/parsers/src/openapi/3.1/paths/__test__/OperationObjectConverter.node.test.ts @@ -1,6 +1,6 @@ import { OpenAPIV3_1 } from "openapi-types"; -import { createMockContext } from "../../../../__test__/createMockContext.util"; import { FernRegistry } from "../../../../client/generated"; +import { createMockContext } from "../../../__test__/createMockContext.util"; import { OperationObjectConverterNode } from "../OperationObjectConverter.node"; describe("OperationObjectConverterNode", () => { diff --git a/packages/parsers/src/openapi/3.1/paths/__test__/PathItemObjectConverter.node.test.ts b/packages/parsers/src/openapi/3.1/paths/__test__/PathItemObjectConverter.node.test.ts index 9c467c44e6..7d9b767d02 100644 --- a/packages/parsers/src/openapi/3.1/paths/__test__/PathItemObjectConverter.node.test.ts +++ b/packages/parsers/src/openapi/3.1/paths/__test__/PathItemObjectConverter.node.test.ts @@ -1,5 +1,5 @@ import { OpenAPIV3_1 } from "openapi-types"; -import { createMockContext } from "../../../../__test__/createMockContext.util"; +import { createMockContext } from "../../../__test__/createMockContext.util"; import { PathItemObjectConverterNode } from "../PathItemObjectConverter.node"; describe("PathItemObjectConverterNode", () => { diff --git a/packages/parsers/src/openapi/3.1/paths/__test__/PathsObjectConverter.node.test.ts b/packages/parsers/src/openapi/3.1/paths/__test__/PathsObjectConverter.node.test.ts index ad04beebc4..6362a2c51d 100644 --- a/packages/parsers/src/openapi/3.1/paths/__test__/PathsObjectConverter.node.test.ts +++ b/packages/parsers/src/openapi/3.1/paths/__test__/PathsObjectConverter.node.test.ts @@ -1,5 +1,5 @@ import { OpenAPIV3_1 } from "openapi-types"; -import { createMockContext } from "../../../../__test__/createMockContext.util"; +import { createMockContext } from "../../../__test__/createMockContext.util"; import { PathsObjectConverterNode } from "../PathsObjectConverter.node"; describe("PathsObjectConverterNode", () => { diff --git a/packages/parsers/src/openapi/3.1/paths/__test__/ServerObjectConverter.node.test.ts b/packages/parsers/src/openapi/3.1/paths/__test__/ServerObjectConverter.node.test.ts index fa1cdfd479..46a29dd90b 100644 --- a/packages/parsers/src/openapi/3.1/paths/__test__/ServerObjectConverter.node.test.ts +++ b/packages/parsers/src/openapi/3.1/paths/__test__/ServerObjectConverter.node.test.ts @@ -1,6 +1,6 @@ import { OpenAPIV3_1 } from "openapi-types"; -import { createMockContext } from "../../../../__test__/createMockContext.util"; import { FernRegistry } from "../../../../client/generated"; +import { createMockContext } from "../../../__test__/createMockContext.util"; import { ServerObjectConverterNode } from "../ServerObjectConverter.node"; describe("ServerObjectConverterNode", () => { diff --git a/packages/parsers/src/openapi/3.1/paths/__test__/TagsObjectConverter.node.test.ts b/packages/parsers/src/openapi/3.1/paths/__test__/TagsObjectConverter.node.test.ts index 46c841eaf0..d534ed7e3b 100644 --- a/packages/parsers/src/openapi/3.1/paths/__test__/TagsObjectConverter.node.test.ts +++ b/packages/parsers/src/openapi/3.1/paths/__test__/TagsObjectConverter.node.test.ts @@ -1,5 +1,5 @@ import { OpenAPIV3_1 } from "openapi-types"; -import { createMockContext } from "../../../../__test__/createMockContext.util"; +import { createMockContext } from "../../../__test__/createMockContext.util"; import { BaseOpenApiV3_1ConverterNodeConstructorArgs } from "../../../BaseOpenApiV3_1Converter.node"; import { TagObjectConverterNode } from "../TagsObjectConverter.node"; diff --git a/packages/parsers/src/openapi/3.1/paths/__test__/parameters/ParameterBaseObjectConverter.node.test.ts b/packages/parsers/src/openapi/3.1/paths/__test__/parameters/ParameterBaseObjectConverter.node.test.ts index 656e29bfe3..7e7ff403c4 100644 --- a/packages/parsers/src/openapi/3.1/paths/__test__/parameters/ParameterBaseObjectConverter.node.test.ts +++ b/packages/parsers/src/openapi/3.1/paths/__test__/parameters/ParameterBaseObjectConverter.node.test.ts @@ -1,5 +1,5 @@ import { OpenAPIV3_1 } from "openapi-types"; -import { createMockContext } from "../../../../../__test__/createMockContext.util"; +import { createMockContext } from "../../../../__test__/createMockContext.util"; import { ParameterBaseObjectConverterNode } from "../../parameters/ParameterBaseObjectConverter.node"; describe("ParameterBaseObjectConverterNode", () => { diff --git a/packages/parsers/src/openapi/3.1/paths/__test__/request/ExampleObjectConverter.node.test.ts b/packages/parsers/src/openapi/3.1/paths/__test__/request/ExampleObjectConverter.node.test.ts index 1003ad27b1..e474a53cdc 100644 --- a/packages/parsers/src/openapi/3.1/paths/__test__/request/ExampleObjectConverter.node.test.ts +++ b/packages/parsers/src/openapi/3.1/paths/__test__/request/ExampleObjectConverter.node.test.ts @@ -1,5 +1,5 @@ import { OpenAPIV3_1 } from "openapi-types"; -import { createMockContext } from "../../../../../__test__/createMockContext.util"; +import { createMockContext } from "../../../../__test__/createMockContext.util"; import { BaseOpenApiV3_1ConverterNodeConstructorArgs } from "../../../../BaseOpenApiV3_1Converter.node"; import { ExampleObjectConverterNode } from "../../ExampleObjectConverter.node"; import { RequestMediaTypeObjectConverterNode } from "../../request/RequestMediaTypeObjectConverter.node"; diff --git a/packages/parsers/src/openapi/3.1/paths/__test__/request/MultipartFormDataPropertySchemaConverter.node.test.ts b/packages/parsers/src/openapi/3.1/paths/__test__/request/MultipartFormDataPropertySchemaConverter.node.test.ts index 667e8a5b42..ce4afc59b1 100644 --- a/packages/parsers/src/openapi/3.1/paths/__test__/request/MultipartFormDataPropertySchemaConverter.node.test.ts +++ b/packages/parsers/src/openapi/3.1/paths/__test__/request/MultipartFormDataPropertySchemaConverter.node.test.ts @@ -1,5 +1,5 @@ import { OpenAPIV3_1 } from "openapi-types"; -import { createMockContext } from "../../../../../__test__/createMockContext.util"; +import { createMockContext } from "../../../../__test__/createMockContext.util"; import { MultipartFormDataPropertySchemaConverterNode } from "../../request/MultipartFormDataPropertySchemaConverter.node"; describe("MultipartFormDataPropertySchemaConverterNode", () => { diff --git a/packages/parsers/src/openapi/3.1/paths/__test__/request/RequestBodyObjectConverter.node.test.ts b/packages/parsers/src/openapi/3.1/paths/__test__/request/RequestBodyObjectConverter.node.test.ts index 715471c131..7536e29515 100644 --- a/packages/parsers/src/openapi/3.1/paths/__test__/request/RequestBodyObjectConverter.node.test.ts +++ b/packages/parsers/src/openapi/3.1/paths/__test__/request/RequestBodyObjectConverter.node.test.ts @@ -1,5 +1,5 @@ import { OpenAPIV3_1 } from "openapi-types"; -import { createMockContext } from "../../../../../__test__/createMockContext.util"; +import { createMockContext } from "../../../../__test__/createMockContext.util"; import { RequestBodyObjectConverterNode } from "../../request/RequestBodyObjectConverter.node"; describe("RequestBodyObjectConverterNode", () => { diff --git a/packages/parsers/src/openapi/3.1/paths/__test__/request/RequestMediaTypeObjectConverter.node.test.ts b/packages/parsers/src/openapi/3.1/paths/__test__/request/RequestMediaTypeObjectConverter.node.test.ts index 7a684f0bfe..04025b0b42 100644 --- a/packages/parsers/src/openapi/3.1/paths/__test__/request/RequestMediaTypeObjectConverter.node.test.ts +++ b/packages/parsers/src/openapi/3.1/paths/__test__/request/RequestMediaTypeObjectConverter.node.test.ts @@ -1,5 +1,5 @@ import { OpenAPIV3_1 } from "openapi-types"; -import { createMockContext } from "../../../../../__test__/createMockContext.util"; +import { createMockContext } from "../../../../__test__/createMockContext.util"; import { RequestMediaTypeObjectConverterNode } from "../../request/RequestMediaTypeObjectConverter.node"; describe("RequestMediaTypeObjectConverterNode", () => { diff --git a/packages/parsers/src/openapi/3.1/paths/__test__/response/ResponseMediaTypeObjectConverter.node.test.ts b/packages/parsers/src/openapi/3.1/paths/__test__/response/ResponseMediaTypeObjectConverter.node.test.ts index 0f9d54f846..37b386ebcc 100644 --- a/packages/parsers/src/openapi/3.1/paths/__test__/response/ResponseMediaTypeObjectConverter.node.test.ts +++ b/packages/parsers/src/openapi/3.1/paths/__test__/response/ResponseMediaTypeObjectConverter.node.test.ts @@ -1,5 +1,5 @@ import { OpenAPIV3_1 } from "openapi-types"; -import { createMockContext } from "../../../../../__test__/createMockContext.util"; +import { createMockContext } from "../../../../__test__/createMockContext.util"; import { SchemaConverterNode } from "../../../schemas/SchemaConverter.node"; import { ResponseMediaTypeObjectConverterNode } from "../../response/ResponseMediaTypeObjectConverter.node"; diff --git a/packages/parsers/src/openapi/3.1/paths/__test__/response/ResponseObjectConverter.node.test.ts b/packages/parsers/src/openapi/3.1/paths/__test__/response/ResponseObjectConverter.node.test.ts index c649fbdf25..0b9f6c3f52 100644 --- a/packages/parsers/src/openapi/3.1/paths/__test__/response/ResponseObjectConverter.node.test.ts +++ b/packages/parsers/src/openapi/3.1/paths/__test__/response/ResponseObjectConverter.node.test.ts @@ -1,5 +1,5 @@ import { OpenAPIV3_1 } from "openapi-types"; -import { createMockContext } from "../../../../../__test__/createMockContext.util"; +import { createMockContext } from "../../../../__test__/createMockContext.util"; import { ResponseObjectConverterNode } from "../../response/ResponseObjectConverter.node"; describe("ResponseObjectConverterNode", () => { diff --git a/packages/parsers/src/openapi/3.1/paths/__test__/response/ResponsesObjectConverter.node.test.ts b/packages/parsers/src/openapi/3.1/paths/__test__/response/ResponsesObjectConverter.node.test.ts index a772a0e4a7..5899b80524 100644 --- a/packages/parsers/src/openapi/3.1/paths/__test__/response/ResponsesObjectConverter.node.test.ts +++ b/packages/parsers/src/openapi/3.1/paths/__test__/response/ResponsesObjectConverter.node.test.ts @@ -1,5 +1,5 @@ import { OpenAPIV3_1 } from "openapi-types"; -import { createMockContext } from "../../../../../__test__/createMockContext.util"; +import { createMockContext } from "../../../../__test__/createMockContext.util"; import { ResponsesObjectConverterNode } from "../../response/ResponsesObjectConverter.node"; describe("ResponsesObjectConverterNode", () => { diff --git a/packages/parsers/src/openapi/3.1/schemas/ComponentsConverter.node.ts b/packages/parsers/src/openapi/3.1/schemas/ComponentsConverter.node.ts index 20a6bbdb49..2e0ca6c0ce 100644 --- a/packages/parsers/src/openapi/3.1/schemas/ComponentsConverter.node.ts +++ b/packages/parsers/src/openapi/3.1/schemas/ComponentsConverter.node.ts @@ -1,4 +1,5 @@ import { isNonNullish } from "@fern-api/ui-core-utils"; +import { Components } from "@open-rpc/meta-schema"; import { OpenAPIV3_1 } from "openapi-types"; import { FernRegistry } from "../../../client/generated"; import { @@ -9,13 +10,15 @@ import { maybeSingleValueToArray } from "../../utils/maybeSingleValueToArray"; import { SchemaConverterNode } from "./SchemaConverter.node"; export class ComponentsConverterNode extends BaseOpenApiV3_1ConverterNode< - OpenAPIV3_1.ComponentsObject, + OpenAPIV3_1.ComponentsObject | Components, FernRegistry.api.latest.ApiDefinition["types"] > { typeSchemas: Record | undefined; constructor( - args: BaseOpenApiV3_1ConverterNodeConstructorArgs + args: BaseOpenApiV3_1ConverterNodeConstructorArgs< + OpenAPIV3_1.ComponentsObject | Components + > ) { super(args); this.safeParse(); diff --git a/packages/parsers/src/openapi/3.1/schemas/__test__/ArrayConverter.node.test.ts b/packages/parsers/src/openapi/3.1/schemas/__test__/ArrayConverter.node.test.ts index 6b301e988c..6895ad9132 100644 --- a/packages/parsers/src/openapi/3.1/schemas/__test__/ArrayConverter.node.test.ts +++ b/packages/parsers/src/openapi/3.1/schemas/__test__/ArrayConverter.node.test.ts @@ -1,5 +1,5 @@ import { OpenAPIV3_1 } from "openapi-types"; -import { createMockContext } from "../../../../__test__/createMockContext.util"; +import { createMockContext } from "../../../__test__/createMockContext.util"; import { ArrayConverterNode } from "../ArrayConverter.node"; import { StringConverterNode } from "../primitives/StringConverter.node"; diff --git a/packages/parsers/src/openapi/3.1/schemas/__test__/ComponentsConverter.node.test.ts b/packages/parsers/src/openapi/3.1/schemas/__test__/ComponentsConverter.node.test.ts index 3fe4ca0a1a..6565719593 100644 --- a/packages/parsers/src/openapi/3.1/schemas/__test__/ComponentsConverter.node.test.ts +++ b/packages/parsers/src/openapi/3.1/schemas/__test__/ComponentsConverter.node.test.ts @@ -1,6 +1,6 @@ import { OpenAPIV3_1 } from "openapi-types"; -import { createMockContext } from "../../../../__test__/createMockContext.util"; import { FernRegistry } from "../../../../client/generated"; +import { createMockContext } from "../../../__test__/createMockContext.util"; import { ComponentsConverterNode } from "../ComponentsConverter.node"; describe("ComponentsConverterNode", () => { diff --git a/packages/parsers/src/openapi/3.1/schemas/__test__/ConstConverterNode.test.ts b/packages/parsers/src/openapi/3.1/schemas/__test__/ConstConverterNode.test.ts index 5b5669936b..a46ad204f0 100644 --- a/packages/parsers/src/openapi/3.1/schemas/__test__/ConstConverterNode.test.ts +++ b/packages/parsers/src/openapi/3.1/schemas/__test__/ConstConverterNode.test.ts @@ -1,4 +1,4 @@ -import { createMockContext } from "../../../../__test__/createMockContext.util"; +import { createMockContext } from "../../../__test__/createMockContext.util"; import { ConstConverterNode } from "../ConstConverter.node"; describe("ConstConverterNode", () => { diff --git a/packages/parsers/src/openapi/3.1/schemas/__test__/MixedSchemaConverter.node.test.ts b/packages/parsers/src/openapi/3.1/schemas/__test__/MixedSchemaConverter.node.test.ts index 5f65002fe8..fc70350593 100644 --- a/packages/parsers/src/openapi/3.1/schemas/__test__/MixedSchemaConverter.node.test.ts +++ b/packages/parsers/src/openapi/3.1/schemas/__test__/MixedSchemaConverter.node.test.ts @@ -1,5 +1,5 @@ -import { createMockContext } from "../../../../__test__/createMockContext.util"; import { FernRegistry } from "../../../../client/generated"; +import { createMockContext } from "../../../__test__/createMockContext.util"; import { MixedSchemaConverterNode } from "../MixedSchemaConverter.node"; describe("MixedSchemaConverterNode", () => { diff --git a/packages/parsers/src/openapi/3.1/schemas/__test__/ObjectConverter.node.test.ts b/packages/parsers/src/openapi/3.1/schemas/__test__/ObjectConverter.node.test.ts index f997cda2de..baa8cea34c 100644 --- a/packages/parsers/src/openapi/3.1/schemas/__test__/ObjectConverter.node.test.ts +++ b/packages/parsers/src/openapi/3.1/schemas/__test__/ObjectConverter.node.test.ts @@ -1,4 +1,4 @@ -import { createMockContext } from "../../../../__test__/createMockContext.util"; +import { createMockContext } from "../../../__test__/createMockContext.util"; import { ObjectConverterNode } from "../ObjectConverter.node"; import { SchemaConverterNode } from "../SchemaConverter.node"; diff --git a/packages/parsers/src/openapi/3.1/schemas/__test__/OneOfConverter.node.test.ts b/packages/parsers/src/openapi/3.1/schemas/__test__/OneOfConverter.node.test.ts index 3e46724b58..acbc49c091 100644 --- a/packages/parsers/src/openapi/3.1/schemas/__test__/OneOfConverter.node.test.ts +++ b/packages/parsers/src/openapi/3.1/schemas/__test__/OneOfConverter.node.test.ts @@ -1,5 +1,5 @@ import { OpenAPIV3_1 } from "openapi-types"; -import { createMockContext } from "../../../../__test__/createMockContext.util"; +import { createMockContext } from "../../../__test__/createMockContext.util"; import { OneOfConverterNode } from "../OneOfConverter.node"; describe("OneOfConverterNode", () => { diff --git a/packages/parsers/src/openapi/3.1/schemas/__test__/ReferenceConverter.node.test.ts b/packages/parsers/src/openapi/3.1/schemas/__test__/ReferenceConverter.node.test.ts index 8117547533..640b607408 100644 --- a/packages/parsers/src/openapi/3.1/schemas/__test__/ReferenceConverter.node.test.ts +++ b/packages/parsers/src/openapi/3.1/schemas/__test__/ReferenceConverter.node.test.ts @@ -1,5 +1,5 @@ import { OpenAPIV3_1 } from "openapi-types"; -import { createMockContext } from "../../../../__test__/createMockContext.util"; +import { createMockContext } from "../../../__test__/createMockContext.util"; import { ReferenceConverterNode } from "../ReferenceConverter.node"; describe("ReferenceConverterNode", () => { diff --git a/packages/parsers/src/openapi/3.1/schemas/__test__/SchemaConverter.node.test.ts b/packages/parsers/src/openapi/3.1/schemas/__test__/SchemaConverter.node.test.ts index 970e9f4cde..4f1a0e3338 100644 --- a/packages/parsers/src/openapi/3.1/schemas/__test__/SchemaConverter.node.test.ts +++ b/packages/parsers/src/openapi/3.1/schemas/__test__/SchemaConverter.node.test.ts @@ -1,5 +1,5 @@ import { OpenAPIV3_1 } from "openapi-types"; -import { createMockContext } from "../../../../__test__/createMockContext.util"; +import { createMockContext } from "../../../__test__/createMockContext.util"; import { ObjectConverterNode } from "../ObjectConverter.node"; import { ReferenceConverterNode } from "../ReferenceConverter.node"; import { SchemaConverterNode } from "../SchemaConverter.node"; diff --git a/packages/parsers/src/openapi/3.1/schemas/primitives/__test__/BooleanConverter.node.test.ts b/packages/parsers/src/openapi/3.1/schemas/primitives/__test__/BooleanConverter.node.test.ts index cdc61dd6ee..c42bfde6f4 100644 --- a/packages/parsers/src/openapi/3.1/schemas/primitives/__test__/BooleanConverter.node.test.ts +++ b/packages/parsers/src/openapi/3.1/schemas/primitives/__test__/BooleanConverter.node.test.ts @@ -1,4 +1,4 @@ -import { createMockContext } from "../../../../../__test__/createMockContext.util"; +import { createMockContext } from "../../../../__test__/createMockContext.util"; import { BooleanConverterNode } from "../BooleanConverter.node"; describe("BooleanConverterNode", () => { diff --git a/packages/parsers/src/openapi/3.1/schemas/primitives/__test__/EnumConverter.node.test.ts b/packages/parsers/src/openapi/3.1/schemas/primitives/__test__/EnumConverter.node.test.ts index 5a80d6bc47..81b2b5c228 100644 --- a/packages/parsers/src/openapi/3.1/schemas/primitives/__test__/EnumConverter.node.test.ts +++ b/packages/parsers/src/openapi/3.1/schemas/primitives/__test__/EnumConverter.node.test.ts @@ -1,5 +1,5 @@ import { OpenAPIV3_1 } from "openapi-types"; -import { createMockContext } from "../../../../../__test__/createMockContext.util"; +import { createMockContext } from "../../../../__test__/createMockContext.util"; import { EnumConverterNode } from "../EnumConverter.node"; describe("EnumConverterNode", () => { diff --git a/packages/parsers/src/openapi/3.1/schemas/primitives/__test__/IntegerConverter.node.test.ts b/packages/parsers/src/openapi/3.1/schemas/primitives/__test__/IntegerConverter.node.test.ts index 2364203c6c..220a867ab2 100644 --- a/packages/parsers/src/openapi/3.1/schemas/primitives/__test__/IntegerConverter.node.test.ts +++ b/packages/parsers/src/openapi/3.1/schemas/primitives/__test__/IntegerConverter.node.test.ts @@ -1,4 +1,4 @@ -import { createMockContext } from "../../../../../__test__/createMockContext.util"; +import { createMockContext } from "../../../../__test__/createMockContext.util"; import { OPENAPI_INTEGER_TYPE_FORMAT } from "../../../../types/format.types"; import { IntegerConverterNode } from "../IntegerConverter.node"; diff --git a/packages/parsers/src/openapi/3.1/schemas/primitives/__test__/NullConverter.node.test.ts b/packages/parsers/src/openapi/3.1/schemas/primitives/__test__/NullConverter.node.test.ts index 647fd82e1f..f5a7239e84 100644 --- a/packages/parsers/src/openapi/3.1/schemas/primitives/__test__/NullConverter.node.test.ts +++ b/packages/parsers/src/openapi/3.1/schemas/primitives/__test__/NullConverter.node.test.ts @@ -1,4 +1,4 @@ -import { createMockContext } from "../../../../../__test__/createMockContext.util"; +import { createMockContext } from "../../../../__test__/createMockContext.util"; import { NullConverterNode } from "../NullConverter.node"; describe("NullConverterNode", () => { diff --git a/packages/parsers/src/openapi/3.1/schemas/primitives/__test__/NumberConverter.node.test.ts b/packages/parsers/src/openapi/3.1/schemas/primitives/__test__/NumberConverter.node.test.ts index fc159a92a3..9146cb0d0f 100644 --- a/packages/parsers/src/openapi/3.1/schemas/primitives/__test__/NumberConverter.node.test.ts +++ b/packages/parsers/src/openapi/3.1/schemas/primitives/__test__/NumberConverter.node.test.ts @@ -1,4 +1,4 @@ -import { createMockContext } from "../../../../../__test__/createMockContext.util"; +import { createMockContext } from "../../../../__test__/createMockContext.util"; import { OPENAPI_NUMBER_TYPE_FORMAT } from "../../../../types/format.types"; import { NumberConverterNode } from "../NumberConverter.node"; diff --git a/packages/parsers/src/openapi/3.1/schemas/primitives/__test__/StringConverter.node.test.ts b/packages/parsers/src/openapi/3.1/schemas/primitives/__test__/StringConverter.node.test.ts index 8320fefc17..c0fe079bfa 100644 --- a/packages/parsers/src/openapi/3.1/schemas/primitives/__test__/StringConverter.node.test.ts +++ b/packages/parsers/src/openapi/3.1/schemas/primitives/__test__/StringConverter.node.test.ts @@ -1,4 +1,4 @@ -import { createMockContext } from "../../../../../__test__/createMockContext.util"; +import { createMockContext } from "../../../../__test__/createMockContext.util"; import { StringConverterNode } from "../StringConverter.node"; describe("StringConverterNode", () => { diff --git a/packages/parsers/src/__test__/createSnapshots.test.ts b/packages/parsers/src/openapi/__test__/OpenApiDocumentConverterNode.test.ts similarity index 87% rename from packages/parsers/src/__test__/createSnapshots.test.ts rename to packages/parsers/src/openapi/__test__/OpenApiDocumentConverterNode.test.ts index 5bdcf7947a..5b6996ee79 100644 --- a/packages/parsers/src/__test__/createSnapshots.test.ts +++ b/packages/parsers/src/openapi/__test__/OpenApiDocumentConverterNode.test.ts @@ -3,9 +3,9 @@ import yaml from "js-yaml"; import { OpenAPIV3_1 } from "openapi-types"; import * as path from "path"; import { describe, expect, it } from "vitest"; -import { ErrorCollector } from "../ErrorCollector"; -import { OpenApiDocumentConverterNode } from "../openapi/3.1/OpenApiDocumentConverter.node"; -import { BaseOpenApiV3_1ConverterNodeContext } from "../openapi/BaseOpenApiV3_1Converter.node"; +import { ErrorCollector } from "../../ErrorCollector"; +import { OpenApiDocumentConverterNode } from "../3.1/OpenApiDocumentConverter.node"; +import { BaseOpenApiV3_1ConverterNodeContext } from "../BaseOpenApiV3_1Converter.node"; function replaceEndpointUUIDs(json: string): string { return json.replace( @@ -69,7 +69,7 @@ describe("OpenAPI snapshot tests", () => { converted.id = "test-uuid-replacement"; await expect( replaceEndpointUUIDs(JSON.stringify(converted, null, 2)) - ).toMatchFileSnapshot(`./__snapshots__/openapi/${directory}.json`); + ).toMatchFileSnapshot(`./__snapshots__/${directory}.json`); }); }); }); diff --git a/packages/parsers/src/__test__/__snapshots__/openapi/cohere.json b/packages/parsers/src/openapi/__test__/__snapshots__/cohere.json similarity index 100% rename from packages/parsers/src/__test__/__snapshots__/openapi/cohere.json rename to packages/parsers/src/openapi/__test__/__snapshots__/cohere.json diff --git a/packages/parsers/src/__test__/__snapshots__/openapi/deeptune.json b/packages/parsers/src/openapi/__test__/__snapshots__/deeptune.json similarity index 100% rename from packages/parsers/src/__test__/__snapshots__/openapi/deeptune.json rename to packages/parsers/src/openapi/__test__/__snapshots__/deeptune.json diff --git a/packages/parsers/src/__test__/__snapshots__/openapi/petstore.json b/packages/parsers/src/openapi/__test__/__snapshots__/petstore.json similarity index 100% rename from packages/parsers/src/__test__/__snapshots__/openapi/petstore.json rename to packages/parsers/src/openapi/__test__/__snapshots__/petstore.json diff --git a/packages/parsers/src/__test__/__snapshots__/openapi/uploadcare.json b/packages/parsers/src/openapi/__test__/__snapshots__/uploadcare.json similarity index 100% rename from packages/parsers/src/__test__/__snapshots__/openapi/uploadcare.json rename to packages/parsers/src/openapi/__test__/__snapshots__/uploadcare.json diff --git a/packages/parsers/src/__test__/createMockContext.util.ts b/packages/parsers/src/openapi/__test__/createMockContext.util.ts similarity index 83% rename from packages/parsers/src/__test__/createMockContext.util.ts rename to packages/parsers/src/openapi/__test__/createMockContext.util.ts index c23931d2d5..bf6bda860d 100644 --- a/packages/parsers/src/__test__/createMockContext.util.ts +++ b/packages/parsers/src/openapi/__test__/createMockContext.util.ts @@ -1,6 +1,6 @@ import { OpenAPIV3_1 } from "openapi-types"; import { vi } from "vitest"; -import { BaseOpenApiV3_1ConverterNodeContext } from "../openapi/BaseOpenApiV3_1Converter.node"; +import { BaseOpenApiV3_1ConverterNodeContext } from "../BaseOpenApiV3_1Converter.node"; export function createMockContext( document?: OpenAPIV3_1.Document diff --git a/packages/parsers/src/__test__/fixtures/cohere/openapi.yml b/packages/parsers/src/openapi/__test__/fixtures/cohere/openapi.yml similarity index 100% rename from packages/parsers/src/__test__/fixtures/cohere/openapi.yml rename to packages/parsers/src/openapi/__test__/fixtures/cohere/openapi.yml diff --git a/packages/parsers/src/__test__/fixtures/deeptune/openapi.yml b/packages/parsers/src/openapi/__test__/fixtures/deeptune/openapi.yml similarity index 100% rename from packages/parsers/src/__test__/fixtures/deeptune/openapi.yml rename to packages/parsers/src/openapi/__test__/fixtures/deeptune/openapi.yml diff --git a/packages/parsers/src/__test__/fixtures/petstore/openapi.yml b/packages/parsers/src/openapi/__test__/fixtures/petstore/openapi.yml similarity index 100% rename from packages/parsers/src/__test__/fixtures/petstore/openapi.yml rename to packages/parsers/src/openapi/__test__/fixtures/petstore/openapi.yml diff --git a/packages/parsers/src/__test__/fixtures/uploadcare/openapi.yml b/packages/parsers/src/openapi/__test__/fixtures/uploadcare/openapi.yml similarity index 100% rename from packages/parsers/src/__test__/fixtures/uploadcare/openapi.yml rename to packages/parsers/src/openapi/__test__/fixtures/uploadcare/openapi.yml diff --git a/packages/parsers/src/openapi/utils/__test__/3.1/coalesceServers.test.ts b/packages/parsers/src/openapi/utils/__test__/3.1/coalesceServers.test.ts index fe25781fa9..1819b23c14 100644 --- a/packages/parsers/src/openapi/utils/__test__/3.1/coalesceServers.test.ts +++ b/packages/parsers/src/openapi/utils/__test__/3.1/coalesceServers.test.ts @@ -1,6 +1,6 @@ import { OpenAPIV3_1 } from "openapi-types"; -import { createMockContext } from "../../../../__test__/createMockContext.util"; import { ServerObjectConverterNode } from "../../../3.1/paths/ServerObjectConverter.node"; +import { createMockContext } from "../../../__test__/createMockContext.util"; import { coalesceServers } from "../../3.1/coalesceServers"; describe("coalesceServers", () => { diff --git a/packages/parsers/src/openapi/utils/__test__/3.1/convertToObjectProperties.test.ts b/packages/parsers/src/openapi/utils/__test__/3.1/convertToObjectProperties.test.ts index 8d3daacc5b..2bf71114f0 100644 --- a/packages/parsers/src/openapi/utils/__test__/3.1/convertToObjectProperties.test.ts +++ b/packages/parsers/src/openapi/utils/__test__/3.1/convertToObjectProperties.test.ts @@ -1,7 +1,7 @@ -import { createMockContext } from "../../../../__test__/createMockContext.util"; import { FernRegistry } from "../../../../client/generated"; import { SchemaConverterNode } from "../../../3.1"; import { AvailabilityConverterNode } from "../../../3.1/extensions/AvailabilityConverter.node"; +import { createMockContext } from "../../../__test__/createMockContext.util"; import { convertToObjectProperties } from "../../3.1/convertToObjectProperties"; describe("convertToObjectProperties", () => { diff --git a/packages/parsers/src/openrpc/1.x/OpenrpcDocumentConverter.node.ts b/packages/parsers/src/openrpc/1.x/OpenrpcDocumentConverter.node.ts new file mode 100644 index 0000000000..377ab9b189 --- /dev/null +++ b/packages/parsers/src/openrpc/1.x/OpenrpcDocumentConverter.node.ts @@ -0,0 +1,49 @@ +import { OpenrpcDocument } from "@open-rpc/meta-schema"; +import { v4 } from "uuid"; +import { FernRegistry } from "../../client/generated"; +import { ComponentsConverterNode } from "../../openapi/3.1/schemas/ComponentsConverter.node"; +import { + BaseOpenrpcConverterNode, + BaseOpenrpcConverterNodeConstructorArgs, +} from "../BaseOpenrpcConverter.node"; + +export class OpenrpcDocumentConverterNode extends BaseOpenrpcConverterNode< + OpenrpcDocument, + FernRegistry.api.latest.ApiDefinition +> { + components: ComponentsConverterNode | undefined; + + constructor(args: BaseOpenrpcConverterNodeConstructorArgs) { + super(args); + this.safeParse(); + } + + parse(): void { + if (this.context.document.components != null) { + this.components = new ComponentsConverterNode({ + input: this.context.document.components, + context: this.context, + accessPath: this.accessPath, + pathId: "components", + }); + } + } + + convert(): FernRegistry.api.latest.ApiDefinition | undefined { + const apiDefinitionId = v4(); + const types = this.components?.convert(); + + return { + id: FernRegistry.ApiDefinitionId(apiDefinitionId), + types: Object.fromEntries( + Object.entries(types ?? {}).map(([id, type]) => [id, type]) + ), + endpoints: {}, + websockets: {}, + webhooks: {}, + subpackages: {}, + auths: {}, + globalHeaders: [], + }; + } +} diff --git a/packages/parsers/src/openrpc/BaseOpenApiV3_1Converter.node.ts b/packages/parsers/src/openrpc/BaseOpenrpcConverter.node.ts similarity index 65% rename from packages/parsers/src/openrpc/BaseOpenApiV3_1Converter.node.ts rename to packages/parsers/src/openrpc/BaseOpenrpcConverter.node.ts index ff18811ed5..dfb6b06e9b 100644 --- a/packages/parsers/src/openrpc/BaseOpenApiV3_1Converter.node.ts +++ b/packages/parsers/src/openrpc/BaseOpenrpcConverter.node.ts @@ -1,25 +1,23 @@ import type { OpenrpcDocument } from "@open-rpc/meta-schema"; -import { - BaseApiConverterNode, - BaseApiConverterNodeContext, -} from "../BaseApiConverter.node"; +import { BaseApiConverterNode } from "../BaseApiConverter.node"; +import { BaseOpenApiV3_1ConverterNodeContext } from "../openapi"; -export abstract class BaseOpenrpc_ConverterNodeContext extends BaseApiConverterNodeContext { - public abstract document: OpenrpcDocument; +export abstract class BaseOpenrpcConverterNodeContext extends BaseOpenApiV3_1ConverterNodeContext { + public abstract openrpc: OpenrpcDocument; } -export type BaseOpenrpc_ConverterNodeConstructorArgs = { +export type BaseOpenrpcConverterNodeConstructorArgs = { input: Input; - context: BaseOpenrpc_ConverterNodeContext; + context: BaseOpenrpcConverterNodeContext; readonly accessPath: string[]; readonly pathId: string; }; -export abstract class BaseOpenApiV3_1ConverterNode< +export abstract class BaseOpenrpcConverterNode< Input, Output, > extends BaseApiConverterNode { - protected override readonly context: BaseOpenrpc_ConverterNodeContext; + protected override readonly context: BaseOpenrpcConverterNodeContext; protected readonly accessPath: string[]; protected readonly pathId: string; @@ -28,7 +26,7 @@ export abstract class BaseOpenApiV3_1ConverterNode< context, accessPath, pathId, - }: BaseOpenrpc_ConverterNodeConstructorArgs) { + }: BaseOpenrpcConverterNodeConstructorArgs) { super(input, context); this.context = context; diff --git a/packages/parsers/src/openrpc/__test__/OpenrpcConverter.test.ts b/packages/parsers/src/openrpc/__test__/OpenrpcConverter.test.ts new file mode 100644 index 0000000000..08f46b1387 --- /dev/null +++ b/packages/parsers/src/openrpc/__test__/OpenrpcConverter.test.ts @@ -0,0 +1,61 @@ +import { OpenrpcDocument } from "@open-rpc/meta-schema"; +import * as fs from "fs"; +import yaml from "js-yaml"; +import * as path from "path"; +import { describe, expect, it } from "vitest"; +import { OpenrpcDocumentConverterNode } from "../1.x/OpenrpcDocumentConverter.node"; +import { createMockContext } from "./createMockContext.util"; + +function replaceEndpointUUIDs(json: string): string { + return json.replace( + /"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"/g, + '"test-uuid-replacement"' + ); +} + +describe("OpenRPC converter", () => { + const fixturesDir = path.join(__dirname, "fixtures"); + const files = fs.readdirSync(fixturesDir); + + files.forEach((directory) => { + it(`generates snapshot for ${directory}`, async () => { + // Read and parse YAML file + const filePath = path.join(fixturesDir, directory, "openrpc.json"); + const fileContents = fs.readFileSync(filePath, "utf8"); + const parsed = yaml.load(fileContents) as OpenrpcDocument; + + // Convert components if they exist + let converted; + const errors = []; + const warnings = []; + + expect(parsed.components?.schemas).toBeDefined(); + + if (parsed.components?.schemas) { + const converter = new OpenrpcDocumentConverterNode({ + input: parsed, + context: createMockContext(parsed), + accessPath: [], + pathId: directory, + }); + errors.push(...converter.errors()); + warnings.push(...converter.warnings()); + converted = converter.convert(); + } + + // Create snapshot + if (errors.length > 0) { + // console.error("errors:", errors); + } + // expect(errors).toHaveLength(0); + if (warnings.length > 0) { + // console.warn("warnings:", warnings); + } + + converted.id = "test-uuid-replacement"; + await expect( + replaceEndpointUUIDs(JSON.stringify(converted, null, 2)) + ).toMatchFileSnapshot(`./__snapshots__/${directory}.json`); + }); + }); +}); diff --git a/packages/parsers/src/openrpc/__test__/__snapshots__/petstore.json b/packages/parsers/src/openrpc/__test__/__snapshots__/petstore.json new file mode 100644 index 0000000000..ce2e090f5a --- /dev/null +++ b/packages/parsers/src/openrpc/__test__/__snapshots__/petstore.json @@ -0,0 +1,89 @@ +{ + "id": "test-uuid-replacement", + "types": { + "PetId": { + "name": "PetId", + "shape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "integer", + "minimum": 0 + } + } + } + }, + "Pet": { + "name": "Pet", + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "id", + "valueShape": { + "type": "alias", + "value": { + "type": "id", + "id": "PetId" + } + } + }, + { + "key": "name", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + }, + { + "key": "tag", + "valueShape": { + "type": "alias", + "value": { + "type": "optional", + "shape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + } + } + ] + } + }, + "Pets": { + "name": "Pets", + "shape": { + "type": "alias", + "value": { + "type": "list", + "itemShape": { + "type": "alias", + "value": { + "type": "id", + "id": "Pet" + } + } + } + } + } + }, + "endpoints": {}, + "websockets": {}, + "webhooks": {}, + "subpackages": {}, + "auths": {}, + "globalHeaders": [] +} \ No newline at end of file diff --git a/packages/parsers/src/openrpc/__test__/createMockContext.util.ts b/packages/parsers/src/openrpc/__test__/createMockContext.util.ts new file mode 100644 index 0000000000..6e543af081 --- /dev/null +++ b/packages/parsers/src/openrpc/__test__/createMockContext.util.ts @@ -0,0 +1,33 @@ +import { OpenrpcDocument } from "@open-rpc/meta-schema"; +import { vi } from "vitest"; +import { BaseOpenrpcConverterNodeContext } from "../BaseOpenrpcConverter.node"; + +export function createMockContext( + document?: OpenrpcDocument +): BaseOpenrpcConverterNodeContext { + return { + document: { + openapi: "3.1.0", + info: { + title: "Mock API", + version: "1.0.0", + }, + paths: {}, + components: document.components, + }, + openrpc: document, + logger: { + info: vi.fn(), + warn: vi.fn(), + error: vi.fn(), + debug: vi.fn(), + log: vi.fn(), + }, + errors: { + error: vi.fn(), + warning: vi.fn(), + warnings: [], + errors: [], + }, + }; +} diff --git a/packages/parsers/src/openrpc/__test__/fixtures/petstore/openrpc.json b/packages/parsers/src/openrpc/__test__/fixtures/petstore/openrpc.json new file mode 100644 index 0000000000..0979e1b3b4 --- /dev/null +++ b/packages/parsers/src/openrpc/__test__/fixtures/petstore/openrpc.json @@ -0,0 +1,204 @@ +{ + "openrpc": "1.0.0-rc1", + "info": { + "version": "1.0.0", + "title": "Petstore", + "license": { + "name": "MIT" + } + }, + "servers": [ + { + "url": "http://localhost:8080" + } + ], + "methods": [ + { + "name": "list_pets", + "summary": "List all pets", + "tags": [ + { + "name": "pets" + } + ], + "params": [ + { + "name": "limit", + "description": "How many items to return at one time (max 100)", + "required": false, + "schema": { + "type": "integer", + "minimum": 1 + } + } + ], + "result": { + "name": "pets", + "description": "A paged array of pets", + "schema": { + "$ref": "#/components/schemas/Pets" + } + }, + "errors": [ + { + "code": 100, + "message": "pets busy" + } + ], + "examples": [ + { + "name": "listPetExample", + "description": "List pet example", + "params": [ + { + "name": "limit", + "value": 1 + } + ], + "result": { + "name": "listPetResultExample", + "value": [ + { + "id": 7, + "name": "fluffy", + "tag": "poodle" + } + ] + } + } + ] + }, + { + "name": "create_pet", + "summary": "Create a pet", + "tags": [ + { + "name": "pets" + } + ], + "params": [ + { + "name": "newPetName", + "description": "Name of pet to create", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "newPetTag", + "description": "Pet tag to create", + "schema": { + "type": "string" + } + } + ], + "examples": [ + { + "name": "createPetExample", + "description": "Create pet example", + "params": [ + { + "name": "newPetName", + "value": "fluffy" + }, + { + "name": "tag", + "value": "poodle" + } + ], + "result": { + "name": "listPetResultExample", + "value": 7 + } + } + ], + "result": { + "$ref": "#/components/contentDescriptors/PetId" + } + }, + { + "name": "get_pet", + "summary": "Info for a specific pet", + "tags": [ + { + "name": "pets" + } + ], + "params": [ + { + "$ref": "#/components/contentDescriptors/PetId" + } + ], + "result": { + "name": "pet", + "description": "Expected response to a valid request", + "schema": { + "$ref": "#/components/schemas/Pet" + } + }, + "examples": [ + { + "name": "getPetExample", + "description": "get pet example", + "params": [ + { + "name": "petId", + "value": 7 + } + ], + "result": { + "name": "getPetExampleResult", + "value": { + "name": "fluffy", + "tag": "poodle", + "id": 7 + } + } + } + ] + } + ], + "components": { + "contentDescriptors": { + "PetId": { + "name": "petId", + "required": true, + "description": "The id of the pet to retrieve", + "schema": { + "$ref": "#/components/schemas/PetId" + } + } + }, + "schemas": { + "PetId": { + "type": "integer", + "minimum": 0 + }, + "Pet": { + "type": "object", + "required": [ + "id", + "name" + ], + "properties": { + "id": { + "$ref": "#/components/schemas/PetId" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + }, + "Pets": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Pet" + } + } + } + } +} diff --git a/packages/parsers/src/openrpc/index.ts b/packages/parsers/src/openrpc/index.ts index bbe79f3042..b77629909d 100644 --- a/packages/parsers/src/openrpc/index.ts +++ b/packages/parsers/src/openrpc/index.ts @@ -1 +1 @@ -export * from "./BaseOpenApiV3_1Converter.node"; +export * from "./BaseOpenrpcConverter.node"; From 69227e26a3d6d061d264e49f55a0dd0b7ea064ad Mon Sep 17 00:00:00 2001 From: Catherine Deskur <46695336+chdeskur@users.noreply.github.com> Date: Mon, 13 Jan 2025 17:45:24 -0500 Subject: [PATCH 6/6] fix: copy to clipboard ui update (#2000) --- packages/fern-docs/components/src/CopyToClipboardButton.tsx | 2 +- .../__snapshots__/CopyToClipboardButton.test.tsx.snap | 2 +- .../syntax-highlighter/src/CodeBlockWithClipboardButton.tsx | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/fern-docs/components/src/CopyToClipboardButton.tsx b/packages/fern-docs/components/src/CopyToClipboardButton.tsx index 3e651533a9..e613b4faf9 100644 --- a/packages/fern-docs/components/src/CopyToClipboardButton.tsx +++ b/packages/fern-docs/components/src/CopyToClipboardButton.tsx @@ -40,7 +40,7 @@ export const CopyToClipboardButton: React.FC = ({ copyToClipboard?.(); }) ?? ( { onClick?.(e); diff --git a/packages/fern-docs/components/src/__test__/__snapshots__/CopyToClipboardButton.test.tsx.snap b/packages/fern-docs/components/src/__test__/__snapshots__/CopyToClipboardButton.test.tsx.snap index 861f37e221..94d5d20daa 100644 --- a/packages/fern-docs/components/src/__test__/__snapshots__/CopyToClipboardButton.test.tsx.snap +++ b/packages/fern-docs/components/src/__test__/__snapshots__/CopyToClipboardButton.test.tsx.snap @@ -3,7 +3,7 @@ exports[`CopyToClipboardButton > renders correctly 1`] = `