diff --git a/fern/pages/changelogs/cli/2024-09-07.mdx b/fern/pages/changelogs/cli/2024-09-07.mdx index 38e4771764e..0496759d5fa 100644 --- a/fern/pages/changelogs/cli/2024-09-07.mdx +++ b/fern/pages/changelogs/cli/2024-09-07.mdx @@ -1,11 +1,9 @@ ## 0.41.6 - **`(feat):`** The Fern Docs CLI now supports OAuth 2.0 Client Credentials injection in API playgrounds. To enable this feature, you can define the OAuth Authorization Scheme in your API configuration, and enable the feature in your docs configuration. API configuration: - ```yml api: auth-schemes: @@ -15,16 +13,15 @@ api: get-token: endpoint: endpoint.authorization ``` - [More Information](https://buildwithfern.com/learn/api-definition/fern/authentication#oauth-client-credentials) Docs configuration: - ```yml navigation: section: API Reference playground: oauth: true ``` +[More Information](https://buildwithfern.com/learn/docs/api-references/customize-api-playground) + -[More Information](https://buildwithfern.com/learn/docs/api-references/api-playground/advanced-configuration#enabling-oauth-20-authorization-injection) diff --git a/fern/pages/changelogs/cli/2024-11-18.mdx b/fern/pages/changelogs/cli/2024-11-18.mdx new file mode 100644 index 00000000000..92ed07722d6 --- /dev/null +++ b/fern/pages/changelogs/cli/2024-11-18.mdx @@ -0,0 +1,4 @@ +## 0.45.0-rc45 +**`(fix):`** The IR handles converting example unions that are aliases. + + diff --git a/packages/cli/cli/versions.yml b/packages/cli/cli/versions.yml index a26a2a3cc3b..318d283f847 100644 --- a/packages/cli/cli/versions.yml +++ b/packages/cli/cli/versions.yml @@ -1,3 +1,10 @@ +- changelogEntry: + - summary: | + The IR handles converting example unions that are aliases. + type: fix + irVersion: 53 + version: 0.45.0-rc45 + - changelogEntry: - summary: | Update the IR's `ServiceTypeReferenceInfo` to include all transitive types diff --git a/packages/cli/generation/ir-generator/src/converters/type-declarations/convertExampleType.ts b/packages/cli/generation/ir-generator/src/converters/type-declarations/convertExampleType.ts index e809bc466a1..b9d442adcb3 100644 --- a/packages/cli/generation/ir-generator/src/converters/type-declarations/convertExampleType.ts +++ b/packages/cli/generation/ir-generator/src/converters/type-declarations/convertExampleType.ts @@ -13,6 +13,7 @@ import { } from "@fern-api/ir-sdk"; import { FernWorkspace } from "@fern-api/api-workspace-commons"; import { + isRawAliasDefinition, isRawObjectDefinition, RawSchemas, visitRawTypeDeclaration, @@ -665,10 +666,19 @@ function convertSingleUnionType({ throw new Error("Example is not an object"); } const { [discriminant]: _discriminantValue, ...nonDiscriminantPropertiesFromExample } = example; - const rawDeclaration = typeResolver.getDeclarationOfNamedTypeOrThrow({ + let rawDeclaration = typeResolver.getDeclarationOfNamedTypeOrThrow({ referenceToNamedType: rawValueType, file: fileContainingType }); + while (isRawAliasDefinition(rawDeclaration.declaration)) { + rawDeclaration = typeResolver.getDeclarationOfNamedTypeOrThrow({ + referenceToNamedType: + typeof rawDeclaration.declaration === "string" + ? rawDeclaration.declaration + : rawDeclaration.declaration.type, + file: fileContainingType + }); + } if (!isRawObjectDefinition(rawDeclaration.declaration)) { throw new Error(`${rawValueType} is not an object`); }