diff --git a/.github/actions/cached-seed/action.yaml b/.github/actions/cached-seed/action.yaml index 6ed00e72e1e0..e888a04ceacb 100644 --- a/.github/actions/cached-seed/action.yaml +++ b/.github/actions/cached-seed/action.yaml @@ -36,12 +36,35 @@ runs: uses: ./.github/actions/install - name: Log in to Docker Hub + id: docker-login if: ${{ inputs.dockerhub-username != '' }} uses: docker/login-action@v3 + continue-on-error: true with: username: ${{ inputs.dockerhub-username }} password: ${{ inputs.dockerhub-token }} + - name: Retry Docker Hub login + id: docker-login-retry + if: ${{ inputs.dockerhub-username != '' && steps.docker-login.outcome == 'failure' }} + uses: docker/login-action@v3 + continue-on-error: true + with: + username: ${{ inputs.dockerhub-username }} + password: ${{ inputs.dockerhub-token }} + + - name: Docker Hub login status + if: ${{ inputs.dockerhub-username != '' }} + shell: bash + run: | + if [[ "${{ steps.docker-login.outcome }}" == "success" ]]; then + echo "Docker Hub login succeeded on first attempt" + elif [[ "${{ steps.docker-login-retry.outcome }}" == "success" ]]; then + echo "Docker Hub login succeeded on retry" + else + echo "::warning::Docker Hub login failed after 2 attempts — continuing without authentication (may hit rate limits)" + fi + - name: Clear stale Docker image cache shell: bash run: rm -rf /tmp/docker-cache diff --git a/generators/go-v2/ast/src/utils/resolveRootImportPath.ts b/generators/go-v2/ast/src/utils/resolveRootImportPath.ts index 5785eb7f7253..c9e732ca02d8 100644 --- a/generators/go-v2/ast/src/utils/resolveRootImportPath.ts +++ b/generators/go-v2/ast/src/utils/resolveRootImportPath.ts @@ -62,11 +62,11 @@ function getMajorVersionSuffix({ config }: { config: FernGeneratorExec.config.Ge // prefix, e.g. "v0", "v1", "v2", etc. function parseMajorVersion({ config }: { config: FernGeneratorExec.config.GeneratorConfig }): string | undefined { const version = getVersion(config); - if (version == null) { + if (version == null || version === "") { return undefined; } const split = version.split("."); - if (split[0] == null) { + if (split[0] == null || split[0] === "" || split[0] === "v") { return undefined; } const majorVersion = split[0]; diff --git a/generators/go-v2/sdk/src/wire-tests/WireTestGenerator.ts b/generators/go-v2/sdk/src/wire-tests/WireTestGenerator.ts index b2e3853a085d..f0914fcd990c 100644 --- a/generators/go-v2/sdk/src/wire-tests/WireTestGenerator.ts +++ b/generators/go-v2/sdk/src/wire-tests/WireTestGenerator.ts @@ -611,26 +611,74 @@ export class WireTestGenerator { endpoint: FernIr.HttpEndpoint; snippet: string; }): go.CodeBlock { - // Generate the client constructor directly with WireMockBaseURL instead of parsing from snippet - // The snippet uses the original constructor args (e.g., WithToken), but we need WithBaseURL + // Generate the client constructor with WireMockBaseURL and auth options matching the WireMock matchers. return go.codeblock((writer) => { writer.write("client := "); + const arguments_: go.AstNode[] = [ + go.invokeFunc({ + func: go.typeReference({ + name: "WithBaseURL", + importPath: this.context.getOptionImportPath() + }), + arguments_: [go.codeblock("WireMockBaseURL")], + multiline: false + }) + ]; + // Add auth options when the endpoint requires authentication, so that the + // request matches the WireMock stub's header matchers. + if (endpoint.auth) { + for (const scheme of this.context.ir.auth.schemes) { + switch (scheme.type) { + case "bearer": + arguments_.push( + go.invokeFunc({ + func: go.typeReference({ + name: "WithToken", + importPath: this.context.getOptionImportPath() + }), + arguments_: [go.codeblock('"test-token"')], + multiline: false + }) + ); + break; + case "basic": + arguments_.push( + go.invokeFunc({ + func: go.typeReference({ + name: "WithBasicAuth", + importPath: this.context.getOptionImportPath() + }), + arguments_: [go.codeblock('"test-username"'), go.codeblock('"test-password"')], + multiline: false + }) + ); + break; + case "header": { + const fieldName = scheme.name?.name?.pascalCase?.unsafeName; + if (fieldName) { + arguments_.push( + go.invokeFunc({ + func: go.typeReference({ + name: `With${fieldName}`, + importPath: this.context.getOptionImportPath() + }), + arguments_: [go.codeblock('"test-value"')], + multiline: false + }) + ); + } + break; + } + } + } + } writer.writeNode( go.invokeFunc({ func: go.typeReference({ name: this.context.getClientConstructorName(), importPath: this.context.getRootClientImportPath() }), - arguments_: [ - go.invokeFunc({ - func: go.typeReference({ - name: "WithBaseURL", - importPath: this.context.getOptionImportPath() - }), - arguments_: [go.codeblock("WireMockBaseURL")], - multiline: false - }) - ], + arguments_, multiline: true }) ); diff --git a/generators/go/sdk/versions.yml b/generators/go/sdk/versions.yml index 296bd56f9a5b..1503ab4e1924 100644 --- a/generators/go/sdk/versions.yml +++ b/generators/go/sdk/versions.yml @@ -1,4 +1,25 @@ # yaml-language-server: $schema=../../../fern-versions-yml.schema.json +- version: 1.33.5 + changelogEntry: + - summary: | + Fix dynamic snippet import paths receiving a spurious `/v` suffix when + the SDK version is empty or invalid (e.g. `""`). The major-version + parser now returns `undefined` for empty and bare-`v` version strings + instead of producing an erroneous `v` suffix. + type: fix + createdAt: "2026-04-08" + irVersion: 61 + +- version: 1.33.4 + changelogEntry: + - summary: | + Fix wire test client construction to include auth options (e.g. + WithToken) when the endpoint requires authentication, so that + requests match WireMock stub header matchers. + type: fix + createdAt: "2026-04-08" + irVersion: 61 + - version: 1.33.3 changelogEntry: - summary: | diff --git a/generators/java-v2/dynamic-snippets/src/context/DynamicTypeLiteralMapper.ts b/generators/java-v2/dynamic-snippets/src/context/DynamicTypeLiteralMapper.ts index 1dcb3d8d0a24..019320133c13 100644 --- a/generators/java-v2/dynamic-snippets/src/context/DynamicTypeLiteralMapper.ts +++ b/generators/java-v2/dynamic-snippets/src/context/DynamicTypeLiteralMapper.ts @@ -419,9 +419,10 @@ export class DynamicTypeLiteralMapper { as?: DynamicTypeLiteralMapper.ConvertedAs; inUndiscriminatedUnion?: boolean; }): java.TypeLiteral { + const valueRecord = this.context.getRecord(value) ?? {}; const properties = this.context.associateByWireValue({ parameters: object_.properties, - values: this.context.getRecord(value) ?? {} + values: valueRecord }); // Add missing required properties with default values to ensure valid staged builder code. // Java uses type-state staged builders where required fields must be set before build() can @@ -449,8 +450,10 @@ export class DynamicTypeLiteralMapper { // Re-sort all properties (including newly added defaults) to match schema declaration order. // Java staged builders require method calls in the exact order defined by the schema. const paramOrderMap = new Map(); + const declaredWireValues = new Set(); object_.properties.forEach((param, index) => { paramOrderMap.set(param.name.wireValue, index); + declaredWireValues.add(param.name.wireValue); }); properties.sort( (a, b) => (paramOrderMap.get(a.name.wireValue) ?? 0) - (paramOrderMap.get(b.name.wireValue) ?? 0) @@ -486,6 +489,19 @@ export class DynamicTypeLiteralMapper { this.context.errors.unscope(); } } + // Handle extra properties not in the schema via .additionalProperty() builder + // calls so the serialized output matches the example data. + for (const [key, val] of Object.entries(valueRecord)) { + if (!declaredWireValues.has(key) && val !== undefined) { + const rawValue = this.convertToRawJavaLiteral(val); + if (rawValue != null) { + builderParameters.push({ + name: "additionalProperty", + value: java.TypeLiteral.raw(`"${this.escapeJavaString(key)}", ${rawValue}`) + }); + } + } + } return java.TypeLiteral.builder({ classReference: this.context.getJavaClassReferenceFromDeclaration({ declaration: object_.declaration @@ -494,6 +510,31 @@ export class DynamicTypeLiteralMapper { }); } + private convertToRawJavaLiteral(value: unknown): string | null { + if (typeof value === "string") { + return `"${this.escapeJavaString(value)}"`; + } + if (typeof value === "number") { + return value.toString(); + } + if (typeof value === "boolean") { + return value.toString(); + } + if (value === null) { + return "null"; + } + return null; + } + + private escapeJavaString(s: string): string { + return s + .replace(/\\/g, "\\\\") + .replace(/"/g, '\\"') + .replace(/\n/g, "\\n") + .replace(/\t/g, "\\t") + .replace(/\r/g, "\\r"); + } + private getDefaultValueForTypeReference(typeReference: FernIr.dynamic.TypeReference): unknown { switch (typeReference.type) { case "primitive": diff --git a/generators/java/sdk/versions.yml b/generators/java/sdk/versions.yml index 1f529dfd3b5b..e6b5283682f7 100644 --- a/generators/java/sdk/versions.yml +++ b/generators/java/sdk/versions.yml @@ -1,4 +1,15 @@ # yaml-language-server: $schema=../../../fern-versions-yml.schema.json +- version: 4.1.2 + changelogEntry: + - summary: | + Fix wire test snippets dropping additional properties not declared in the + schema. Types with `@JsonAnySetter` now emit `.additionalProperty()` builder + calls for extra fields present in example data, so the serialized output + matches the expected JSON. + type: fix + createdAt: "2026-04-08" + irVersion: 65 + - version: 4.1.1 changelogEntry: - summary: | diff --git a/packages/cli/api-importers/openapi/openapi-ir-parser/src/schema/convertSchemas.ts b/packages/cli/api-importers/openapi/openapi-ir-parser/src/schema/convertSchemas.ts index 61e22c712566..9c88546466fb 100644 --- a/packages/cli/api-importers/openapi/openapi-ir-parser/src/schema/convertSchemas.ts +++ b/packages/cli/api-importers/openapi/openapi-ir-parser/src/schema/convertSchemas.ts @@ -605,7 +605,9 @@ export function convertSchemaObject( // primitive types if (schema.type === "boolean") { const literalValue = getExtension(schema, FernOpenAPIExtension.BOOLEAN_LITERAL); - const resolvedLiteral = literalValue ?? getSingleBooleanEnumValue(schema, blockConstCoercionToLiteral); + const resolvedLiteral = + literalValue ?? + getSingleBooleanEnumValue(schema, blockConstCoercionToLiteral, context.options.coerceEnumsToLiterals); if (resolvedLiteral != null) { return wrapLiteral({ nameOverride, @@ -1508,15 +1510,21 @@ export function convertSchemaObject( /** * Extracts a boolean literal from a single-value enum (e.g. `type: boolean, enum: [true]`). - * Returns undefined if the schema doesn't match or if const-to-literal coercion is blocked. + * Returns undefined if the schema doesn't match, if const-to-literal coercion is blocked, + * or if coerceEnumsToLiterals is false. This is consistent with the string enum path (line ~535) + * which also requires coerceEnumsToLiterals to be true. */ function getSingleBooleanEnumValue( schema: OpenAPIV3.SchemaObject, - blockConstCoercionToLiteral: boolean + blockConstCoercionToLiteral: boolean, + coerceEnumsToLiterals: boolean ): boolean | undefined { if (blockConstCoercionToLiteral) { return undefined; } + if (!coerceEnumsToLiterals) { + return undefined; + } if (schema.enum != null && schema.enum.length === 1 && typeof schema.enum[0] === "boolean") { return schema.enum[0] as boolean; } diff --git a/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-ir/boolean-enum-no-coerce.json b/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-ir/boolean-enum-no-coerce.json new file mode 100644 index 000000000000..62d104d590b4 --- /dev/null +++ b/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi-ir/boolean-enum-no-coerce.json @@ -0,0 +1,336 @@ +{ + "title": "Boolean Enum No Coerce Test", + "description": "Tests that boolean single-value enums are NOT coerced to literals when coerce-enums-to-literals is false, consistent with string enums.", + "servers": [], + "websocketServers": [], + "tags": { + "tagsById": {} + }, + "hasEndpointsMarkedInternal": false, + "endpoints": [ + { + "summary": "Create a new plant", + "audiences": [], + "operationId": "plants_create", + "tags": [ + "Plants" + ], + "pathParameters": [], + "queryParameters": [], + "headers": [], + "generatedRequestName": "PlantsCreateRequest", + "request": { + "schema": { + "generatedName": "PlantsCreateRequest", + "schema": "CreatePlantRequest", + "source": { + "file": "../openapi.yml", + "type": "openapi" + }, + "type": "reference" + }, + "contentType": "application/json", + "fullExamples": [], + "additionalProperties": false, + "source": { + "file": "../openapi.yml", + "type": "openapi" + }, + "type": "json" + }, + "response": { + "description": "Plant created successfully", + "schema": { + "generatedName": "PlantsCreateResponse", + "schema": "Plant", + "source": { + "file": "../openapi.yml", + "type": "openapi" + }, + "type": "reference" + }, + "fullExamples": [], + "source": { + "file": "../openapi.yml", + "type": "openapi" + }, + "statusCode": 201, + "type": "json" + }, + "errors": {}, + "servers": [], + "authed": false, + "method": "POST", + "path": "/plants", + "examples": [ + { + "pathParameters": [], + "queryParameters": [], + "headers": [], + "request": { + "properties": { + "name": { + "value": { + "value": "Fern", + "type": "string" + }, + "type": "primitive" + }, + "isIndoor": { + "value": { + "value": true, + "type": "boolean" + }, + "type": "primitive" + }, + "status": { + "value": "active", + "type": "enum" + } + }, + "type": "object" + }, + "response": { + "value": { + "properties": { + "id": { + "value": { + "value": 123, + "type": "int" + }, + "type": "primitive" + }, + "name": { + "value": { + "value": "Fern", + "type": "string" + }, + "type": "primitive" + }, + "isIndoor": { + "value": { + "value": true, + "type": "boolean" + }, + "type": "primitive" + }, + "isPoisonous": { + "value": { + "value": true, + "type": "boolean" + }, + "type": "primitive" + }, + "status": { + "value": "active", + "type": "enum" + }, + "isSeedling": { + "value": { + "value": true, + "type": "boolean" + }, + "type": "primitive" + } + }, + "type": "object" + }, + "type": "withoutStreaming" + }, + "codeSamples": [], + "type": "full" + } + ], + "source": { + "file": "../openapi.yml", + "type": "openapi" + } + } + ], + "webhooks": [], + "channels": {}, + "groupedSchemas": { + "rootSchemas": { + "CreatePlantRequest": { + "allOf": [], + "properties": [ + { + "conflict": {}, + "generatedName": "createPlantRequestName", + "key": "name", + "schema": { + "schema": { + "example": "Fern", + "type": "string" + }, + "generatedName": "CreatePlantRequestName", + "groupName": [], + "type": "primitive" + }, + "audiences": [] + }, + { + "conflict": {}, + "generatedName": "createPlantRequestIsIndoor", + "key": "isIndoor", + "schema": { + "schema": { + "type": "boolean" + }, + "generatedName": "CreatePlantRequestIsIndoor", + "groupName": [], + "type": "primitive" + }, + "audiences": [] + }, + { + "conflict": {}, + "generatedName": "createPlantRequestStatus", + "key": "status", + "schema": { + "generatedName": "CreatePlantRequestStatus", + "values": [ + { + "generatedName": "active", + "value": "active", + "casing": {} + } + ], + "groupName": [], + "source": { + "file": "../openapi.yml", + "type": "openapi" + }, + "type": "enum" + }, + "audiences": [] + } + ], + "allOfPropertyConflicts": [], + "generatedName": "CreatePlantRequest", + "groupName": [], + "additionalProperties": false, + "source": { + "file": "../openapi.yml", + "type": "openapi" + }, + "type": "object" + }, + "Plant": { + "allOf": [], + "properties": [ + { + "conflict": {}, + "generatedName": "plantId", + "key": "id", + "schema": { + "schema": { + "example": 123, + "type": "int" + }, + "generatedName": "PlantId", + "groupName": [], + "type": "primitive" + }, + "audiences": [] + }, + { + "conflict": {}, + "generatedName": "plantName", + "key": "name", + "schema": { + "schema": { + "example": "Fern", + "type": "string" + }, + "generatedName": "PlantName", + "groupName": [], + "type": "primitive" + }, + "audiences": [] + }, + { + "conflict": {}, + "generatedName": "plantIsIndoor", + "key": "isIndoor", + "schema": { + "schema": { + "type": "boolean" + }, + "generatedName": "PlantIsIndoor", + "groupName": [], + "type": "primitive" + }, + "audiences": [] + }, + { + "conflict": {}, + "generatedName": "plantIsPoisonous", + "key": "isPoisonous", + "schema": { + "schema": { + "type": "boolean" + }, + "generatedName": "PlantIsPoisonous", + "groupName": [], + "type": "primitive" + }, + "audiences": [] + }, + { + "conflict": {}, + "generatedName": "plantStatus", + "key": "status", + "schema": { + "generatedName": "PlantStatus", + "values": [ + { + "generatedName": "active", + "value": "active", + "casing": {} + } + ], + "groupName": [], + "source": { + "file": "../openapi.yml", + "type": "openapi" + }, + "type": "enum" + }, + "audiences": [] + }, + { + "conflict": {}, + "generatedName": "plantIsSeedling", + "key": "isSeedling", + "schema": { + "schema": { + "type": "boolean" + }, + "generatedName": "PlantIsSeedling", + "groupName": [], + "type": "primitive" + }, + "audiences": [] + } + ], + "allOfPropertyConflicts": [], + "generatedName": "Plant", + "groupName": [], + "additionalProperties": false, + "source": { + "file": "../openapi.yml", + "type": "openapi" + }, + "type": "object" + } + }, + "namespacedSchemas": {} + }, + "variables": {}, + "nonRequestReferencedSchemas": {}, + "securitySchemes": {}, + "globalHeaders": [], + "idempotencyHeaders": [], + "groups": {} +} \ No newline at end of file diff --git a/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi/boolean-enum-no-coerce.json b/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi/boolean-enum-no-coerce.json new file mode 100644 index 000000000000..bd09234a22ed --- /dev/null +++ b/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/__snapshots__/openapi/boolean-enum-no-coerce.json @@ -0,0 +1,195 @@ +{ + "absoluteFilePath": "/DUMMY_PATH", + "importedDefinitions": {}, + "namedDefinitionFiles": { + "__package__.yml": { + "absoluteFilepath": "/DUMMY_PATH", + "contents": { + "types": { + "Plant": { + "docs": undefined, + "inline": undefined, + "properties": { + "id": "integer", + "isIndoor": "boolean", + "isPoisonous": "boolean", + "isSeedling": "boolean", + "name": "string", + "status": "PlantStatus", + }, + "source": { + "openapi": "../openapi.yml", + }, + }, + "PlantStatus": { + "enum": [ + "active", + ], + "inline": true, + "source": { + "openapi": "../openapi.yml", + }, + }, + }, + }, + "rawContents": "types: + PlantStatus: + enum: + - active + inline: true + source: + openapi: ../openapi.yml + Plant: + properties: + id: integer + name: string + isIndoor: boolean + isPoisonous: boolean + status: PlantStatus + isSeedling: boolean + source: + openapi: ../openapi.yml +", + }, + "plants.yml": { + "absoluteFilepath": "/DUMMY_PATH", + "contents": { + "imports": { + "root": "__package__.yml", + }, + "service": { + "auth": false, + "base-path": "", + "endpoints": { + "create": { + "auth": undefined, + "display-name": "Create a new plant", + "docs": undefined, + "examples": [ + { + "request": { + "isIndoor": true, + "name": "Fern", + "status": "active", + }, + "response": { + "body": { + "id": 123, + "isIndoor": true, + "isPoisonous": true, + "isSeedling": true, + "name": "Fern", + "status": "active", + }, + }, + }, + ], + "method": "POST", + "pagination": undefined, + "path": "/plants", + "request": { + "body": { + "properties": { + "isIndoor": "boolean", + "name": "string", + "status": "CreatePlantRequestStatus", + }, + }, + "content-type": "application/json", + "headers": undefined, + "name": "CreatePlantRequest", + "path-parameters": undefined, + "query-parameters": undefined, + }, + "response": { + "docs": "Plant created successfully", + "status-code": 201, + "type": "root.Plant", + }, + "source": { + "openapi": "../openapi.yml", + }, + }, + }, + "source": { + "openapi": "../openapi.yml", + }, + }, + "types": { + "CreatePlantRequestStatus": { + "enum": [ + "active", + ], + "inline": true, + "source": { + "openapi": "../openapi.yml", + }, + }, + }, + }, + "rawContents": "types: + CreatePlantRequestStatus: + enum: + - active + inline: true + source: + openapi: ../openapi.yml +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + create: + path: /plants + method: POST + source: + openapi: ../openapi.yml + display-name: Create a new plant + request: + name: CreatePlantRequest + body: + properties: + name: string + isIndoor: boolean + status: CreatePlantRequestStatus + content-type: application/json + response: + docs: Plant created successfully + type: root.Plant + status-code: 201 + examples: + - request: + name: Fern + isIndoor: true + status: active + response: + body: + id: 123 + name: Fern + isIndoor: true + isPoisonous: true + status: active + isSeedling: true + source: + openapi: ../openapi.yml +", + }, + }, + "packageMarkers": {}, + "rootApiFile": { + "contents": { + "display-name": "Boolean Enum No Coerce Test", + "error-discrimination": { + "strategy": "status-code", + }, + "name": "api", + }, + "defaultUrl": undefined, + "rawContents": "name: api +error-discrimination: + strategy: status-code +display-name: Boolean Enum No Coerce Test +", + }, +} \ No newline at end of file diff --git a/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/fixtures/boolean-enum-no-coerce/fern/generators.yml b/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/fixtures/boolean-enum-no-coerce/fern/generators.yml new file mode 100644 index 000000000000..2a0065b45b28 --- /dev/null +++ b/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/fixtures/boolean-enum-no-coerce/fern/generators.yml @@ -0,0 +1,6 @@ +# yaml-language-server: $schema=https://schema.buildwithfern.dev/generators-yml.json +api: + specs: + - openapi: ../openapi.yml + settings: + coerce-enums-to-literals: false diff --git a/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/fixtures/boolean-enum-no-coerce/openapi.yml b/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/fixtures/boolean-enum-no-coerce/openapi.yml new file mode 100644 index 000000000000..d4f5eea9225a --- /dev/null +++ b/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/src/__test__/fixtures/boolean-enum-no-coerce/openapi.yml @@ -0,0 +1,81 @@ +openapi: 3.1.0 +info: + title: Boolean Enum No Coerce Test + version: 1.0.0 + description: >- + Tests that boolean single-value enums are NOT coerced to literals + when coerce-enums-to-literals is false, consistent with string enums. + +paths: + /plants: + post: + summary: Create a new plant + operationId: plants_create + tags: + - Plants + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/CreatePlantRequest" + responses: + "201": + description: Plant created successfully + content: + application/json: + schema: + $ref: "#/components/schemas/Plant" + +components: + schemas: + CreatePlantRequest: + type: object + required: + - name + - isIndoor + - status + properties: + name: + type: string + example: "Fern" + isIndoor: + type: boolean + enum: + - true + status: + type: string + enum: + - active + + Plant: + type: object + required: + - id + - name + - isIndoor + - isPoisonous + - status + - isSeedling + properties: + id: + type: integer + example: 123 + name: + type: string + example: "Fern" + isIndoor: + type: boolean + enum: + - true + isPoisonous: + type: boolean + enum: + - false + status: + type: string + enum: + - active + isSeedling: + type: boolean + const: true diff --git a/packages/cli/cli/versions.yml b/packages/cli/cli/versions.yml index 0c352bc9c823..b9c74e27ab27 100644 --- a/packages/cli/cli/versions.yml +++ b/packages/cli/cli/versions.yml @@ -1,5 +1,49 @@ # yaml-language-server: $schema=../../../fern-versions-yml.schema.json +- version: 4.63.4 + changelogEntry: + - summary: | + Add `no-conflicting-parameter-names` OSS validation rule to `fern check`. + Detects when header parameters and query/path parameters on the same endpoint + normalize to the same camelCase name, which causes broken generated SDK code + (Python SyntaxError from duplicate keyword arguments, TypeScript duplicate + interface properties). The rule reports an error at validation time so the + collision is caught before code generation. + type: fix + createdAt: "2026-04-08" + irVersion: 66 + +- version: 4.63.3 + changelogEntry: + - summary: | + Fix `coerce-enums-to-literals: false` not being respected for boolean + single-value enums (`type: boolean, enum: [true]`). Previously, boolean + enums were always coerced to literals regardless of the setting. Now + `getSingleBooleanEnumValue` checks `coerceEnumsToLiterals` consistently + with the string enum path. + type: fix + createdAt: "2026-04-08" + irVersion: 66 +- version: 4.63.2 + changelogEntry: + - summary: | + Add log rotation for `fern docs dev` debug logs in `~/.fern/logs/`. + Old log files are automatically deleted when the directory exceeds + 100 MB, keeping the most recent logs. + type: fix + createdAt: "2026-04-08" + irVersion: 66 +- version: 4.63.1 + changelogEntry: + - summary: | + Fix Go dynamic snippets not being generated during docs publish. + The Go package name comparison between snippet configuration and + generator output was failing due to an `https://` prefix mismatch, + causing docs to fall back to raw `net/http` code instead of + SDK-idiomatic snippets. + type: fix + createdAt: "2026-04-08" + irVersion: 66 - version: 4.63.0 changelogEntry: - summary: | @@ -16,7 +60,6 @@ type: fix createdAt: "2026-04-07" irVersion: 66 - - version: 4.62.5 changelogEntry: - summary: | diff --git a/packages/cli/docs-preview/src/DebugLogger.ts b/packages/cli/docs-preview/src/DebugLogger.ts index a1dce064758d..ca3a1fae01d5 100644 --- a/packages/cli/docs-preview/src/DebugLogger.ts +++ b/packages/cli/docs-preview/src/DebugLogger.ts @@ -1,11 +1,14 @@ import { AbsoluteFilePath, doesPathExist, join, RelativeFilePath } from "@fern-api/fs-utils"; -import { appendFile, mkdir, writeFile } from "fs/promises"; +import { appendFile, mkdir, readdir, stat, unlink, writeFile } from "fs/promises"; import { homedir } from "os"; import path from "path"; const LOCAL_STORAGE_FOLDER = process.env.LOCAL_STORAGE_FOLDER ?? ".fern"; const LOGS_FOLDER_NAME = "logs"; +// 100 MB cap for the logs directory +const MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024; + /** * Log level for debug messages */ @@ -123,6 +126,7 @@ export class DebugLogger { private logFilePath: AbsoluteFilePath | null = null; private initialized = false; private sessionStartTime: number; + private consoleLogger: { debug: (msg: string) => void; info: (msg: string) => void } | undefined; constructor() { this.sessionStartTime = Date.now(); @@ -131,10 +135,11 @@ export class DebugLogger { /** * Initialize the debug logger by creating the log file */ - async initialize(): Promise { + async initialize(consoleLogger?: { debug: (msg: string) => void; info: (msg: string) => void }): Promise { if (this.initialized) { return; } + this.consoleLogger = consoleLogger; const localStorageFolder = join(AbsoluteFilePath.of(homedir()), RelativeFilePath.of(LOCAL_STORAGE_FOLDER)); const logsDir = join(localStorageFolder, RelativeFilePath.of(LOGS_FOLDER_NAME)); @@ -158,6 +163,9 @@ export class DebugLogger { await writeFile(this.logFilePath, header, "utf-8"); this.initialized = true; + + // Enforce the 100 MB cap on the logs directory (fire-and-forget) + void this.enforceLogSizeLimit(logsDir); } /** @@ -293,6 +301,59 @@ export class DebugLogger { await this.logCliMetric(event); } + /** + * Delete oldest log files until total directory size is within the cap. + */ + private async enforceLogSizeLimit(logsDir: AbsoluteFilePath): Promise { + try { + const entries = await readdir(logsDir); + const logFiles = entries.filter((name) => name.endsWith(".log")); + + const fileInfos: Array<{ name: string; fullPath: string; size: number; mtimeMs: number }> = []; + for (const name of logFiles) { + const fullPath = path.join(logsDir, name); + try { + const stats = await stat(fullPath); + fileInfos.push({ name, fullPath, size: stats.size, mtimeMs: stats.mtimeMs }); + } catch { + // File may have been removed between readdir and stat + } + } + + let totalSize = fileInfos.reduce((sum, f) => sum + f.size, 0); + const totalSizeMB = Math.round((totalSize / 1024 / 1024) * 100) / 100; + const capMB = MAX_LOGS_DIR_SIZE_BYTES / 1024 / 1024; + + if (totalSize <= MAX_LOGS_DIR_SIZE_BYTES) { + this.consoleLogger?.debug(`Log directory size ${totalSizeMB} MB does not exceed ${capMB} MB cap`); + return; + } + + this.consoleLogger?.info(`Rotating logs: total size ${totalSizeMB} MB exceeds ${capMB} MB cap`); + + // Sort oldest first so we delete the oldest logs first + fileInfos.sort((a, b) => a.mtimeMs - b.mtimeMs); + + for (const file of fileInfos) { + if (totalSize <= MAX_LOGS_DIR_SIZE_BYTES) { + break; + } + // Never delete the log file we just created in this session + if (this.logFilePath != null && file.fullPath === this.logFilePath) { + continue; + } + try { + await unlink(file.fullPath); + totalSize -= file.size; + } catch { + // Ignore errors from concurrent deletion + } + } + } catch { + // If the directory is unreadable, skip cleanup silently + } + } + private getEventType(payload: MetricEvent | MetricSummary, isAggregate: boolean): string { if (isAggregate) { return "aggregate_summary"; diff --git a/packages/cli/docs-preview/src/runAppPreviewServer.ts b/packages/cli/docs-preview/src/runAppPreviewServer.ts index c1068c7fb6cc..f93e8f74b654 100644 --- a/packages/cli/docs-preview/src/runAppPreviewServer.ts +++ b/packages/cli/docs-preview/src/runAppPreviewServer.ts @@ -6,6 +6,7 @@ import { runExeca } from "@fern-api/logging-execa"; import { Project } from "@fern-api/project-loader"; import { TaskContext } from "@fern-api/task-context"; import chalk from "chalk"; +import { execSync } from "child_process"; import cors from "cors"; import express from "express"; import fs from "fs"; @@ -408,6 +409,54 @@ function cleanFernDocsCacheSync(bundleRoot: string, context: TaskContext): void } } +/** + * Finds and kills any processes still listening on the given port. + * This is a best-effort fallback to clean up zombie Next.js worker + * processes that may survive after the main server process is killed. + */ +function killProcessesOnPort(targetPort: number, context: TaskContext): void { + context.logger.debug(`Killing any leftover processes on port ${targetPort}`); + const isWindows = process.platform === "win32"; + const command = isWindows + ? `netstat -ano | findstr :${targetPort} | findstr LISTENING` + : `lsof -ti tcp:${targetPort}`; + + try { + const output = execSync(command, { encoding: "utf-8", timeout: 5000 }); + + let pids: string[]; + if (isWindows) { + pids = output + .trim() + .split("\n") + .map((line) => line.trim().split(/\s+/).pop() ?? "") + .filter((pid) => pid.length > 0 && pid !== String(process.pid)); + pids = [...new Set(pids)]; + } else { + pids = output + .trim() + .split("\n") + .map((pid) => pid.trim()) + .filter((pid) => pid.length > 0 && pid !== String(process.pid)); + } + + for (const pid of pids) { + try { + context.logger.debug(`Killing leftover process ${pid} on port ${targetPort}`); + if (isWindows) { + execSync(`taskkill /F /PID ${pid}`, { timeout: 5000 }); + } else { + process.kill(Number(pid), "SIGKILL"); + } + } catch { + // Process may have already exited + } + } + } catch { + // Command returns non-zero when no matches are found — nothing to kill + } +} + export async function runAppPreviewServer({ initialProject, reloadProject, @@ -491,7 +540,10 @@ export async function runAppPreviewServer({ // Initialize the debug logger for metrics collection const debugLogger = new DebugLogger(); - await debugLogger.initialize(); + await debugLogger.initialize({ + debug: (msg) => context.logger.debug(msg), + info: (msg) => context.logger.info(msg) + }); const debugLogPath = debugLogger.getLogFilePath(); if (debugLogPath) { context.logger.info(chalk.dim(`Debug log: ${debugLogPath}`)); @@ -799,8 +851,9 @@ export async function runAppPreviewServer({ NODE_OPTIONS: "--max-old-space-size=8096 --enable-source-maps" }; - // Track the current server process + // Track the current server process and the port it actually bound to let serverProcess: ReturnType | null = null; + let actualPort: number = port; // Function to start the Next.js server const startNextJsServer = (): Promise => { @@ -813,6 +866,12 @@ export async function runAppPreviewServer({ const checkReady = (data: Buffer) => { const output = data.toString(); context.logger.debug(`[Next.js] ${output}`); + + const portMatch = output.match(/localhost:(\d+)/); + if (portMatch != null) { + actualPort = Number(portMatch[1]); + } + if (output.includes("Ready in") || output.includes("✓ Ready")) { resolve(); } @@ -952,6 +1011,8 @@ export async function runAppPreviewServer({ } } + killProcessesOnPort(actualPort, context); + // Clean Fern Docs cache on shutdown (sync since cleanup runs in signal handlers) // Uses maxRetries to handle ENOTEMPTY if the server process is still writing cleanFernDocsCacheSync(bundleRoot, context); diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/null-type/type_conversations_OutboundCallConversationsResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/null-type/type_conversations_OutboundCallConversationsResponse.json index d987713c915b..363a33ecc313 100644 --- a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/null-type/type_conversations_OutboundCallConversationsResponse.json +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/null-type/type_conversations_OutboundCallConversationsResponse.json @@ -19,7 +19,7 @@ ] }, "dry_run": { - "const": true + "type": "boolean" } }, "required": [ diff --git a/packages/cli/fern-definition/validator/src/rules/no-conflicting-request-wrapper-properties/__test__/fixtures/simple/definition/camel-case-collision.yml b/packages/cli/fern-definition/validator/src/rules/no-conflicting-request-wrapper-properties/__test__/fixtures/simple/definition/camel-case-collision.yml new file mode 100644 index 000000000000..8a10b6745c28 --- /dev/null +++ b/packages/cli/fern-definition/validator/src/rules/no-conflicting-request-wrapper-properties/__test__/fixtures/simple/definition/camel-case-collision.yml @@ -0,0 +1,19 @@ +service: + auth: true + base-path: /v1/plants + headers: + Organization-Id: + name: organizationId + type: string + docs: The organization context for the request. + endpoints: + list: + method: GET + path: "" + request: + name: ListPlantsRequest + query-parameters: + organization_id: + type: string + docs: The organization to filter plants by. + response: string diff --git a/packages/cli/fern-definition/validator/src/rules/no-conflicting-request-wrapper-properties/__test__/no-conflicting-request-wrapper-properties.test.ts b/packages/cli/fern-definition/validator/src/rules/no-conflicting-request-wrapper-properties/__test__/no-conflicting-request-wrapper-properties.test.ts index c3434268cd77..4f8d36a0b17e 100644 --- a/packages/cli/fern-definition/validator/src/rules/no-conflicting-request-wrapper-properties/__test__/no-conflicting-request-wrapper-properties.test.ts +++ b/packages/cli/fern-definition/validator/src/rules/no-conflicting-request-wrapper-properties/__test__/no-conflicting-request-wrapper-properties.test.ts @@ -59,6 +59,15 @@ describe("no-conflicting-request-wrapper-properties", () => { relativeFilepath: RelativeFilePath.of("body-property-key.yml"), name: "no-conflicting-request-wrapper-properties", severity: "fatal" + }, + { + message: `Multiple request properties resolve to the same generated name organizationId after camelCase normalization. This causes broken generated code. Use the "name" property to disambiguate. + - Service header "Organization-Id" (name: "organizationId") + - Query Parameter "organization_id" (name: "organization_id")`, + nodePath: ["service", "endpoints", "list"], + relativeFilepath: RelativeFilePath.of("camel-case-collision.yml"), + name: "no-conflicting-request-wrapper-properties", + severity: "fatal" } ]); }); diff --git a/packages/cli/fern-definition/validator/src/rules/no-conflicting-request-wrapper-properties/no-conflicting-request-wrapper-properties.ts b/packages/cli/fern-definition/validator/src/rules/no-conflicting-request-wrapper-properties/no-conflicting-request-wrapper-properties.ts index 62a23da325a7..367f095937e9 100644 --- a/packages/cli/fern-definition/validator/src/rules/no-conflicting-request-wrapper-properties/no-conflicting-request-wrapper-properties.ts +++ b/packages/cli/fern-definition/validator/src/rules/no-conflicting-request-wrapper-properties/no-conflicting-request-wrapper-properties.ts @@ -14,6 +14,7 @@ import { TypeResolverImpl } from "@fern-api/ir-generator"; import chalk from "chalk"; +import { camelCase } from "lodash-es"; import { Rule, RuleViolation } from "../../Rule.js"; import { CASINGS_GENERATOR } from "../../utils/casingsGenerator.js"; @@ -49,6 +50,13 @@ export const NoConflictingRequestWrapperPropertiesRule: Rule = { }); } + // Also check for collisions after camelCase normalization. + // Different raw names (e.g. header "Organization-Id" with name: organizationId + // and query param "organization_id") may normalize to the same camelCase name, + // causing broken generated code (duplicate kwargs in Python, duplicate properties in TS). + const camelCaseViolations = getCamelCaseNormalizedCollisions(nameToProperties); + violations.push(...camelCaseViolations); + return violations; } } @@ -208,3 +216,56 @@ function convertRequestWrapperPropertyToString(property: RequestWrapperProperty) assertNever(property); } } + +/** + * Detects collisions that only appear after camelCase normalization. + * For example, header "Organization-Id" (name: organizationId) and query param "organization_id" + * have different raw names but both normalize to "organizationId" in camelCase. + * This causes broken generated code (duplicate kwargs in Python, duplicate properties in TypeScript). + * + * Only reports collisions that were NOT already caught by the raw-name check above + * (i.e., properties that have different raw names but the same camelCase name). + */ +function getCamelCaseNormalizedCollisions(nameToProperties: Record): RuleViolation[] { + // Build a map from camelCase-normalized name to all properties across all raw-name groups. + const camelCaseToEntries: Record = {}; + + for (const [rawName, properties] of Object.entries(nameToProperties)) { + for (const property of properties) { + const normalizedName = camelCase(rawName); + const entries = (camelCaseToEntries[normalizedName] ??= []); + entries.push({ rawName, property }); + } + } + + const violations: RuleViolation[] = []; + for (const [normalizedName, entries] of Object.entries(camelCaseToEntries)) { + if (entries.length <= 1) { + continue; + } + + // Only report if there are entries from different raw-name groups. + // If all entries share the same raw name, the raw-name check above already caught it. + const distinctRawNames = new Set(entries.map((e) => e.rawName)); + if (distinctRawNames.size <= 1) { + continue; + } + + violations.push({ + severity: "fatal", + message: + `Multiple request properties resolve to the same generated name ${chalk.bold( + normalizedName + )} after camelCase normalization. This causes broken generated code. ` + + `Use the "name" property to disambiguate.\n` + + entries + .map( + (entry) => + ` - ${convertRequestWrapperPropertyToString(entry.property)} (name: "${entry.rawName}")` + ) + .join("\n") + }); + } + + return violations; +} diff --git a/packages/cli/generation/ir-generator-tests/src/dynamic-snippets/__test__/test-definitions/null-type.json b/packages/cli/generation/ir-generator-tests/src/dynamic-snippets/__test__/test-definitions/null-type.json index 278bd56d0744..89cadd2bb7ee 100644 --- a/packages/cli/generation/ir-generator-tests/src/dynamic-snippets/__test__/test-definitions/null-type.json +++ b/packages/cli/generation/ir-generator-tests/src/dynamic-snippets/__test__/test-definitions/null-type.json @@ -124,11 +124,8 @@ } }, "typeReference": { - "type": "literal", - "value": { - "type": "boolean", - "value": true - } + "type": "primitive", + "value": "BOOLEAN" }, "propertyAccess": null, "variable": null diff --git a/packages/cli/generation/ir-generator-tests/src/ir/__test__/test-definitions/null-type.json b/packages/cli/generation/ir-generator-tests/src/ir/__test__/test-definitions/null-type.json index e09869cf38f7..d8ce61ac3594 100644 --- a/packages/cli/generation/ir-generator-tests/src/ir/__test__/test-definitions/null-type.json +++ b/packages/cli/generation/ir-generator-tests/src/ir/__test__/test-definitions/null-type.json @@ -53,12 +53,12 @@ { "name": "dry_run", "valueType": { - "_type": "container", - "container": { - "_type": "literal", - "literal": { + "_type": "primitive", + "primitive": { + "v1": "BOOLEAN", + "v2": { "type": "boolean", - "boolean": true + "default": null } } }, @@ -436,13 +436,10 @@ "name": "dry_run", "value": { "shape": { - "type": "container", - "container": { - "type": "literal", - "literal": { - "type": "boolean", - "boolean": true - } + "type": "primitive", + "primitive": { + "type": "boolean", + "boolean": true } }, "jsonExample": true @@ -482,7 +479,7 @@ "autogeneratedExamples": [ { "example": { - "id": "79d2eb53", + "id": "f69c8965", "url": "/conversations/outbound-call", "name": null, "endpointHeaders": [], @@ -606,13 +603,10 @@ }, "value": { "shape": { - "type": "container", - "container": { - "type": "literal", - "literal": { - "type": "boolean", - "boolean": true - } + "type": "primitive", + "primitive": { + "type": "boolean", + "boolean": true } }, "jsonExample": true @@ -1294,11 +1288,8 @@ } }, "typeReference": { - "type": "literal", - "value": { - "type": "boolean", - "value": true - } + "type": "primitive", + "value": "BOOLEAN" }, "propertyAccess": null, "variable": null diff --git a/packages/cli/generation/remote-generation/remote-workspace-runner/src/publishDocs.ts b/packages/cli/generation/remote-generation/remote-workspace-runner/src/publishDocs.ts index 53d749df2f3a..24befc615fb5 100644 --- a/packages/cli/generation/remote-generation/remote-workspace-runner/src/publishDocs.ts +++ b/packages/cli/generation/remote-generation/remote-workspace-runner/src/publishDocs.ts @@ -1216,6 +1216,12 @@ async function generateLanguageSpecificDynamicIRs({ packageName = (generatorInvocation.config as { packageName?: string }).packageName ?? ""; } + // Normalize Go package names to strip https:// prefix, + // matching how snippetConfiguration values are normalized + if (generatorInvocation.language === "go" && packageName) { + packageName = normalizeGoPackageForLookup(packageName); + } + if (!generatorInvocation.language) { continue; } diff --git a/packages/cli/workspace/lazy-fern-workspace/src/protobuf/ProtobufOpenAPIGenerator.ts b/packages/cli/workspace/lazy-fern-workspace/src/protobuf/ProtobufOpenAPIGenerator.ts index 294d834f21bf..f08964456e2f 100644 --- a/packages/cli/workspace/lazy-fern-workspace/src/protobuf/ProtobufOpenAPIGenerator.ts +++ b/packages/cli/workspace/lazy-fern-workspace/src/protobuf/ProtobufOpenAPIGenerator.ts @@ -1,7 +1,7 @@ import { AbsoluteFilePath, join, RelativeFilePath, relative } from "@fern-api/fs-utils"; import { createLoggingExecutable } from "@fern-api/logging-execa"; import { TaskContext } from "@fern-api/task-context"; -import { access, cp, readFile, rename, unlink, writeFile } from "fs/promises"; +import { access, copyFile, cp, readFile, unlink, writeFile } from "fs/promises"; import path from "path"; import tmp from "tmp-promise"; import { resolveProtocGenOpenAPI } from "./ProtocGenOpenAPIDownloader.js"; @@ -168,10 +168,13 @@ export class ProtobufOpenAPIGenerator { this.context.failAndThrow(bufGenerateResult.stderr); } - // Move output to a unique temp file so the next call doesn't overwrite it + // Move output to a unique temp file so the next call doesn't overwrite it. + // Use copyFile + unlink instead of rename because rename fails with EPERM + // on Windows when the target file already exists (tmp.file creates it). const outputPath = join(preparedDir.cwd, RelativeFilePath.of(PROTOBUF_GENERATOR_OUTPUT_FILEPATH)); const uniqueOutput = AbsoluteFilePath.of((await tmp.file({ postfix: ".yaml" })).path); - await rename(outputPath, uniqueOutput); + await copyFile(outputPath, uniqueOutput); + await unlink(outputPath); return { absoluteFilepath: uniqueOutput }; } diff --git a/packages/cli/workspace/oss-validator/src/getAllRules.ts b/packages/cli/workspace/oss-validator/src/getAllRules.ts index b3a2e37ac011..8f6ac243ff83 100644 --- a/packages/cli/workspace/oss-validator/src/getAllRules.ts +++ b/packages/cli/workspace/oss-validator/src/getAllRules.ts @@ -1,5 +1,6 @@ import { Rule } from "./Rule.js"; import { NoComponentSchemaCollisionsRule } from "./rules/no-component-schema-collisions/index.js"; +import { NoConflictingParameterNamesRule } from "./rules/no-conflicting-parameter-names/index.js"; import { NoDuplicateAuthHeaderParametersRule } from "./rules/no-duplicate-auth-header-parameters/index.js"; import { NoDuplicateOverridesRule } from "./rules/no-duplicate-overrides/index.js"; import { NoInvalidTagNamesOrFrontmatterRule } from "./rules/no-invalid-tag-names-or-frontmatter/index.js"; @@ -11,6 +12,7 @@ export function getAllRules(): Rule[] { NoDuplicateOverridesRule, NoSchemaTitleCollisionsRule, NoComponentSchemaCollisionsRule, - NoInvalidTagNamesOrFrontmatterRule + NoInvalidTagNamesOrFrontmatterRule, + NoConflictingParameterNamesRule ]; } diff --git a/packages/cli/workspace/oss-validator/src/rules/no-conflicting-parameter-names/__test__/fixtures/header-path-collision/generators.yml b/packages/cli/workspace/oss-validator/src/rules/no-conflicting-parameter-names/__test__/fixtures/header-path-collision/generators.yml new file mode 100644 index 000000000000..d8bd49b048ba --- /dev/null +++ b/packages/cli/workspace/oss-validator/src/rules/no-conflicting-parameter-names/__test__/fixtures/header-path-collision/generators.yml @@ -0,0 +1,3 @@ +api: + specs: + - openapi: ./openapi.yml diff --git a/packages/cli/workspace/oss-validator/src/rules/no-conflicting-parameter-names/__test__/fixtures/header-path-collision/openapi.yml b/packages/cli/workspace/oss-validator/src/rules/no-conflicting-parameter-names/__test__/fixtures/header-path-collision/openapi.yml new file mode 100644 index 000000000000..4b7572a8bef5 --- /dev/null +++ b/packages/cli/workspace/oss-validator/src/rules/no-conflicting-parameter-names/__test__/fixtures/header-path-collision/openapi.yml @@ -0,0 +1,22 @@ +openapi: 3.0.3 +info: + title: Test API + version: 1.0.0 +paths: + /plants/{plant_id}: + get: + operationId: getPlant + parameters: + - name: Plant-Id + in: header + required: true + schema: + type: string + - name: plant_id + in: path + required: true + schema: + type: string + responses: + "200": + description: OK diff --git a/packages/cli/workspace/oss-validator/src/rules/no-conflicting-parameter-names/__test__/fixtures/header-query-collision/generators.yml b/packages/cli/workspace/oss-validator/src/rules/no-conflicting-parameter-names/__test__/fixtures/header-query-collision/generators.yml new file mode 100644 index 000000000000..d8bd49b048ba --- /dev/null +++ b/packages/cli/workspace/oss-validator/src/rules/no-conflicting-parameter-names/__test__/fixtures/header-query-collision/generators.yml @@ -0,0 +1,3 @@ +api: + specs: + - openapi: ./openapi.yml diff --git a/packages/cli/workspace/oss-validator/src/rules/no-conflicting-parameter-names/__test__/fixtures/header-query-collision/openapi.yml b/packages/cli/workspace/oss-validator/src/rules/no-conflicting-parameter-names/__test__/fixtures/header-query-collision/openapi.yml new file mode 100644 index 000000000000..4feabfc1e3be --- /dev/null +++ b/packages/cli/workspace/oss-validator/src/rules/no-conflicting-parameter-names/__test__/fixtures/header-query-collision/openapi.yml @@ -0,0 +1,28 @@ +openapi: 3.0.3 +info: + title: Test API + version: 1.0.0 +paths: + /plants/{plantId}: + parameters: + - name: Organization-Id + in: header + required: true + schema: + type: string + get: + operationId: getPlant + parameters: + - name: organization_id + in: query + required: true + schema: + type: string + - name: plantId + in: path + required: true + schema: + type: string + responses: + "200": + description: OK diff --git a/packages/cli/workspace/oss-validator/src/rules/no-conflicting-parameter-names/__test__/fixtures/no-collision/generators.yml b/packages/cli/workspace/oss-validator/src/rules/no-conflicting-parameter-names/__test__/fixtures/no-collision/generators.yml new file mode 100644 index 000000000000..d8bd49b048ba --- /dev/null +++ b/packages/cli/workspace/oss-validator/src/rules/no-conflicting-parameter-names/__test__/fixtures/no-collision/generators.yml @@ -0,0 +1,3 @@ +api: + specs: + - openapi: ./openapi.yml diff --git a/packages/cli/workspace/oss-validator/src/rules/no-conflicting-parameter-names/__test__/fixtures/no-collision/openapi.yml b/packages/cli/workspace/oss-validator/src/rules/no-conflicting-parameter-names/__test__/fixtures/no-collision/openapi.yml new file mode 100644 index 000000000000..2f37b07d047f --- /dev/null +++ b/packages/cli/workspace/oss-validator/src/rules/no-conflicting-parameter-names/__test__/fixtures/no-collision/openapi.yml @@ -0,0 +1,28 @@ +openapi: 3.0.3 +info: + title: Test API + version: 1.0.0 +paths: + /plants/{plantId}: + parameters: + - name: X-Request-Id + in: header + required: true + schema: + type: string + get: + operationId: getPlant + parameters: + - name: organization_id + in: query + required: true + schema: + type: string + - name: plantId + in: path + required: true + schema: + type: string + responses: + "200": + description: OK diff --git a/packages/cli/workspace/oss-validator/src/rules/no-conflicting-parameter-names/__test__/no-conflicting-parameter-names.test.ts b/packages/cli/workspace/oss-validator/src/rules/no-conflicting-parameter-names/__test__/no-conflicting-parameter-names.test.ts new file mode 100644 index 000000000000..1b17efe76c0f --- /dev/null +++ b/packages/cli/workspace/oss-validator/src/rules/no-conflicting-parameter-names/__test__/no-conflicting-parameter-names.test.ts @@ -0,0 +1,54 @@ +import { AbsoluteFilePath, join, RelativeFilePath } from "@fern-api/fs-utils"; +import { getViolationsForRule } from "../../../testing-utils/getViolationsForRule"; +import { NoConflictingParameterNamesRule } from "../no-conflicting-parameter-names"; + +describe("no-conflicting-parameter-names", () => { + it("should detect header vs query parameter name collision", async () => { + const violations = await getViolationsForRule({ + rule: NoConflictingParameterNamesRule, + absolutePathToWorkspace: join( + AbsoluteFilePath.of(__dirname), + RelativeFilePath.of("fixtures"), + RelativeFilePath.of("header-query-collision") + ) + }); + + expect(violations.length).toBe(1); + expect(violations[0]?.severity).toBe("error"); + expect(violations[0]?.message).toContain("organizationId"); + expect(violations[0]?.message).toContain("Organization-Id"); + expect(violations[0]?.message).toContain("organization_id"); + expect(violations[0]?.nodePath).toEqual(["paths", "/plants/{plantId}", "get"]); + }, 10_000); + + it("should detect header vs path parameter name collision", async () => { + const violations = await getViolationsForRule({ + rule: NoConflictingParameterNamesRule, + absolutePathToWorkspace: join( + AbsoluteFilePath.of(__dirname), + RelativeFilePath.of("fixtures"), + RelativeFilePath.of("header-path-collision") + ) + }); + + expect(violations.length).toBe(1); + expect(violations[0]?.severity).toBe("error"); + expect(violations[0]?.message).toContain("plantId"); + expect(violations[0]?.message).toContain("Plant-Id"); + expect(violations[0]?.message).toContain("plant_id"); + expect(violations[0]?.nodePath).toEqual(["paths", "/plants/{plant_id}", "get"]); + }, 10_000); + + it("should not report violations when parameters have different normalized names", async () => { + const violations = await getViolationsForRule({ + rule: NoConflictingParameterNamesRule, + absolutePathToWorkspace: join( + AbsoluteFilePath.of(__dirname), + RelativeFilePath.of("fixtures"), + RelativeFilePath.of("no-collision") + ) + }); + + expect(violations).toEqual([]); + }, 10_000); +}); diff --git a/packages/cli/workspace/oss-validator/src/rules/no-conflicting-parameter-names/index.ts b/packages/cli/workspace/oss-validator/src/rules/no-conflicting-parameter-names/index.ts new file mode 100644 index 000000000000..5b5488144951 --- /dev/null +++ b/packages/cli/workspace/oss-validator/src/rules/no-conflicting-parameter-names/index.ts @@ -0,0 +1 @@ +export { NoConflictingParameterNamesRule } from "./no-conflicting-parameter-names.js"; diff --git a/packages/cli/workspace/oss-validator/src/rules/no-conflicting-parameter-names/no-conflicting-parameter-names.ts b/packages/cli/workspace/oss-validator/src/rules/no-conflicting-parameter-names/no-conflicting-parameter-names.ts new file mode 100644 index 000000000000..74d52e57d579 --- /dev/null +++ b/packages/cli/workspace/oss-validator/src/rules/no-conflicting-parameter-names/no-conflicting-parameter-names.ts @@ -0,0 +1,217 @@ +import { isOpenAPIV2 } from "@fern-api/api-workspace-commons"; +import { relative } from "@fern-api/fs-utils"; +import { convertOpenAPIV2ToV3 } from "@fern-api/lazy-fern-workspace"; + +import { Rule } from "../../Rule.js"; +import { ValidationViolation } from "../../ValidationViolation.js"; + +/** + * Validates that OpenAPI specs don't define header parameters whose + * camelCase-normalized names collide with query or path parameters on + * the same endpoint. + * + * When a path-level or operation-level header (e.g. `Organization-Id`) + * normalizes to the same camelCase name as a query or path parameter + * (e.g. `organization_id`), SDK generators produce broken code: + * - Python: SyntaxError from duplicate keyword arguments + * - TypeScript: duplicate interface property that silently shadows one value + */ +export const NoConflictingParameterNamesRule: Rule = { + name: "no-conflicting-parameter-names", + run: async ({ workspace, specs, loadedDocuments }) => { + const violations: ValidationViolation[] = []; + + for (const spec of specs) { + if (spec.type !== "openapi") { + continue; + } + + const openAPI = loadedDocuments.get(spec.absoluteFilepath); + if (openAPI == null) { + continue; + } + + const apiToValidate = isOpenAPIV2(openAPI) ? await convertOpenAPIV2ToV3(openAPI) : openAPI; + const relativeFilepath = relative(workspace.absoluteFilePath, spec.source.file); + + for (const [path, pathItem] of Object.entries( + ((apiToValidate as Record).paths as Record) ?? {} + )) { + if (pathItem == null || typeof pathItem !== "object") { + continue; + } + + const pathItemObj = pathItem as Record; + + // Collect path-level parameters + const pathLevelParams = resolveAllParams(pathItemObj.parameters, apiToValidate); + + // Check each operation + for (const method of ["get", "put", "post", "delete", "options", "head", "patch", "trace"]) { + const operation = pathItemObj[method] as { parameters?: unknown[] } | undefined; + if (operation == null) { + continue; + } + + // Collect operation-level parameters + const operationParams = resolveAllParams(operation.parameters, apiToValidate); + + // Merge path-level and operation-level parameters. + // Operation-level params override path-level params with the same `in` + `name`. + const mergedParams = mergeParameters(pathLevelParams, operationParams); + + // Group parameters by their camelCase-normalized name + const nameToParams: Record = {}; + for (const param of mergedParams) { + const normalizedName = toCamelCase(param.name); + if (normalizedName === "") { + continue; + } + const existing = (nameToParams[normalizedName] ??= []); + existing.push(param); + } + + // Check for collisions between different parameter types + for (const [normalizedName, params] of Object.entries(nameToParams)) { + if (params.length <= 1) { + continue; + } + + // Only report collisions that involve at least two different `in` locations + // (e.g. header + query, header + path). Same-type duplicates are a different issue. + const distinctTypes = new Set(params.map((p) => p.in)); + if (distinctTypes.size <= 1) { + continue; + } + + const paramDescriptions = params.map((p) => `${p.in} parameter '${p.name}'`).join(", "); + + violations.push({ + name: "no-conflicting-parameter-names", + severity: "error", + relativeFilepath, + nodePath: ["paths", path, method], + message: + `Parameters ${paramDescriptions} all normalize to '${normalizedName}' in generated SDKs. ` + + `This causes broken code (duplicate keyword arguments in Python, duplicate properties in TypeScript). ` + + `Rename one of the parameters to avoid the collision.` + }); + } + } + } + } + + return violations; + } +}; + +interface ResolvedParam { + in: string; + name: string; +} + +/** + * Resolves an array of parameters (which may contain $ref objects) into + * a flat array of ResolvedParam objects. + */ +function resolveAllParams( + params: unknown, + // biome-ignore lint/suspicious/noExplicitAny: OpenAPI document type + api: any +): ResolvedParam[] { + if (!Array.isArray(params)) { + return []; + } + const result: ResolvedParam[] = []; + for (const param of params) { + const resolved = resolveParam(param, api); + if (resolved != null) { + result.push(resolved); + } + } + return result; +} + +/** + * Resolves a parameter, handling $ref if needed. + */ +function resolveParam( + param: unknown, + // biome-ignore lint/suspicious/noExplicitAny: OpenAPI document type + api: any, + visited: Set = new Set() +): ResolvedParam | undefined { + if (typeof param !== "object" || param == null) { + return undefined; + } + + const paramObj = param as Record; + + // Handle $ref + if (typeof paramObj.$ref === "string") { + const refPath = paramObj.$ref; + if (visited.has(refPath)) { + return undefined; + } + if (refPath.startsWith("#/components/parameters/")) { + const paramName = refPath.substring("#/components/parameters/".length); + const components = api.components as { parameters?: Record } | undefined; + const resolved = components?.parameters?.[paramName]; + if (resolved != null) { + visited.add(refPath); + return resolveParam(resolved, api, visited); + } + } + // Try Swagger 2.0 style refs + if (refPath.startsWith("#/parameters/")) { + const paramName = refPath.substring("#/parameters/".length); + const parameters = api.parameters as Record | undefined; + const resolved = parameters?.[paramName]; + if (resolved != null) { + visited.add(refPath); + return resolveParam(resolved, api, visited); + } + } + return undefined; + } + + if (typeof paramObj.in === "string" && typeof paramObj.name === "string") { + return { in: paramObj.in, name: paramObj.name }; + } + + return undefined; +} + +/** + * Merges path-level and operation-level parameters following the OpenAPI spec: + * operation-level parameters override path-level parameters with the same + * `in` + `name` combination. + */ +function mergeParameters(pathParams: ResolvedParam[], operationParams: ResolvedParam[]): ResolvedParam[] { + const operationParamKeys = new Set(operationParams.map((p) => `${p.in}:${p.name}`)); + const merged = [...operationParams]; + for (const pathParam of pathParams) { + const key = `${pathParam.in}:${pathParam.name}`; + if (!operationParamKeys.has(key)) { + merged.push(pathParam); + } + } + return merged; +} + +/** + * Converts a parameter name to camelCase, matching the normalization + * that SDK generators apply. Handles kebab-case, snake_case, and + * PascalCase inputs. + * + * Examples: + * "Organization-Id" → "organizationId" + * "organization_id" → "organizationId" + * "Plant-Id" → "plantId" + * "plant_id" → "plantId" + */ +function toCamelCase(input: string): string { + return input + .replace(/[-_]+(.)?/g, (_, char: string | undefined) => (char != null ? char.toUpperCase() : "")) + .replace(/^[A-Z]/, (char) => char.toLowerCase()); +} diff --git a/scripts/worktree-add.sh b/scripts/worktree-add.sh index d1f67fbcc229..0eafbef4f621 100755 --- a/scripts/worktree-add.sh +++ b/scripts/worktree-add.sh @@ -31,9 +31,15 @@ if [ -z "$path" ]; then path="$WORKTREE_BASE/$branch" fi +# Fetch the branch from origin if it exists remotely, so we track it +# instead of creating a disconnected local branch. +git fetch origin "$branch" 2>/dev/null || true + # Create worktree — use -b if the branch doesn't exist yet if git show-ref --verify --quiet "refs/heads/$branch"; then git worktree add "$path" "$branch" +elif git show-ref --verify --quiet "refs/remotes/origin/$branch"; then + git worktree add --track -b "$branch" "$path" "origin/$branch" else git worktree add -b "$branch" "$path" fi diff --git a/seed/go-model/null-type/conversations.go b/seed/go-model/null-type/conversations.go index 911a161cc791..06c6f4daf4b4 100644 --- a/seed/go-model/null-type/conversations.go +++ b/seed/go-model/null-type/conversations.go @@ -12,8 +12,9 @@ import ( type OutboundCallConversationsResponse struct { // Always null when dry_run is true. ConversationId any `json:"conversation_id" url:"conversation_id"` + // Always true for this response. + DryRun bool `json:"dry_run" url:"dry_run"` - dryRun bool extraProperties map[string]any rawJSON json.RawMessage } @@ -29,7 +30,7 @@ func (o *OutboundCallConversationsResponse) GetDryRun() bool { if o == nil { return false } - return o.dryRun + return o.DryRun } func (o *OutboundCallConversationsResponse) GetExtraProperties() map[string]any { @@ -42,22 +43,13 @@ func (o *OutboundCallConversationsResponse) GetExtraProperties() map[string]any func (o *OutboundCallConversationsResponse) UnmarshalJSON( data []byte, ) error { - type embed OutboundCallConversationsResponse - var unmarshaler = struct { - embed - DryRun bool `json:"dry_run"` - }{ - embed: embed(*o), - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { + type unmarshaler OutboundCallConversationsResponse + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { return err } - *o = OutboundCallConversationsResponse(unmarshaler.embed) - if unmarshaler.DryRun != true { - return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", o, true, unmarshaler.DryRun) - } - o.dryRun = unmarshaler.DryRun - extraProperties, err := internal.ExtractExtraProperties(data, *o, "dryRun") + *o = OutboundCallConversationsResponse(value) + extraProperties, err := internal.ExtractExtraProperties(data, *o) if err != nil { return err } @@ -66,18 +58,6 @@ func (o *OutboundCallConversationsResponse) UnmarshalJSON( return nil } -func (o *OutboundCallConversationsResponse) MarshalJSON() ([]byte, error) { - type embed OutboundCallConversationsResponse - var marshaler = struct { - embed - DryRun bool `json:"dry_run"` - }{ - embed: embed(*o), - DryRun: true, - } - return json.Marshal(marshaler) -} - func (o *OutboundCallConversationsResponse) String() string { if len(o.rawJSON) > 0 { if value, err := internal.StringifyJSON(o.rawJSON); err == nil { diff --git a/seed/go-sdk/exhaustive/no-custom-config/endpoints/container/endpoints_container_test/endpoints_container_test.go b/seed/go-sdk/exhaustive/no-custom-config/endpoints/container/endpoints_container_test/endpoints_container_test.go index 16aad0cb263b..452efec4e2a3 100644 --- a/seed/go-sdk/exhaustive/no-custom-config/endpoints/container/endpoints_container_test/endpoints_container_test.go +++ b/seed/go-sdk/exhaustive/no-custom-config/endpoints/container/endpoints_container_test/endpoints_container_test.go @@ -72,6 +72,7 @@ func TestEndpointsContainerGetAndReturnListOfPrimitivesWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := []string{ "string", @@ -98,6 +99,7 @@ func TestEndpointsContainerGetAndReturnListOfObjectsWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := []*types.ObjectWithRequiredField{ &types.ObjectWithRequiredField{ @@ -128,6 +130,7 @@ func TestEndpointsContainerGetAndReturnSetOfPrimitivesWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := []string{ "string", @@ -153,6 +156,7 @@ func TestEndpointsContainerGetAndReturnSetOfObjectsWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := []*types.ObjectWithRequiredField{ &types.ObjectWithRequiredField{ @@ -180,6 +184,7 @@ func TestEndpointsContainerGetAndReturnMapPrimToPrimWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := map[string]string{ "string": "string", @@ -205,6 +210,7 @@ func TestEndpointsContainerGetAndReturnMapOfPrimToObjectWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := map[string]*types.ObjectWithRequiredField{ "string": &types.ObjectWithRequiredField{ @@ -232,6 +238,7 @@ func TestEndpointsContainerGetAndReturnMapOfPrimToUndiscriminatedUnionWithWireMo } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := map[string]*types.MixedType{ "string": &types.MixedType{ @@ -259,6 +266,7 @@ func TestEndpointsContainerGetAndReturnOptionalWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &types.ObjectWithRequiredField{ FieldString: "string", diff --git a/seed/go-sdk/exhaustive/no-custom-config/endpoints/contenttype/endpoints_content_type_test/endpoints_content_type_test.go b/seed/go-sdk/exhaustive/no-custom-config/endpoints/contenttype/endpoints_content_type_test/endpoints_content_type_test.go index 9b12bc7c0d20..7b0e75799564 100644 --- a/seed/go-sdk/exhaustive/no-custom-config/endpoints/contenttype/endpoints_content_type_test/endpoints_content_type_test.go +++ b/seed/go-sdk/exhaustive/no-custom-config/endpoints/contenttype/endpoints_content_type_test/endpoints_content_type_test.go @@ -74,6 +74,7 @@ func TestEndpointsContentTypePostJsonPatchContentTypeWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &types.ObjectWithOptionalField{ FieldString: fern.String( @@ -144,6 +145,7 @@ func TestEndpointsContentTypePostJsonPatchContentWithCharsetTypeWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &types.ObjectWithOptionalField{ FieldString: fern.String( diff --git a/seed/go-sdk/exhaustive/no-custom-config/endpoints/enum/endpoints_enum_test/endpoints_enum_test.go b/seed/go-sdk/exhaustive/no-custom-config/endpoints/enum/endpoints_enum_test/endpoints_enum_test.go index a0d6e579190c..e2d24fd48386 100644 --- a/seed/go-sdk/exhaustive/no-custom-config/endpoints/enum/endpoints_enum_test/endpoints_enum_test.go +++ b/seed/go-sdk/exhaustive/no-custom-config/endpoints/enum/endpoints_enum_test/endpoints_enum_test.go @@ -72,6 +72,7 @@ func TestEndpointsEnumGetAndReturnEnumWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := types.WeatherReportSunny.Ptr() _, invocationErr := client.Endpoints.Enum.GetAndReturnEnum( diff --git a/seed/go-sdk/exhaustive/no-custom-config/endpoints/httpmethods/endpoints_http_methods_test/endpoints_http_methods_test.go b/seed/go-sdk/exhaustive/no-custom-config/endpoints/httpmethods/endpoints_http_methods_test/endpoints_http_methods_test.go index 20105cd5b7b4..13d253cca7ad 100644 --- a/seed/go-sdk/exhaustive/no-custom-config/endpoints/httpmethods/endpoints_http_methods_test/endpoints_http_methods_test.go +++ b/seed/go-sdk/exhaustive/no-custom-config/endpoints/httpmethods/endpoints_http_methods_test/endpoints_http_methods_test.go @@ -74,6 +74,7 @@ func TestEndpointsHttpMethodsTestGetWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) _, invocationErr := client.Endpoints.HttpMethods.TestGet( context.TODO(), @@ -96,6 +97,7 @@ func TestEndpointsHttpMethodsTestPostWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &types.ObjectWithRequiredField{ FieldString: "string", @@ -121,6 +123,7 @@ func TestEndpointsHttpMethodsTestPutWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &types.ObjectWithRequiredField{ FieldString: "string", @@ -147,6 +150,7 @@ func TestEndpointsHttpMethodsTestPatchWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &types.ObjectWithOptionalField{ FieldString: fern.String( @@ -218,6 +222,7 @@ func TestEndpointsHttpMethodsTestDeleteWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) _, invocationErr := client.Endpoints.HttpMethods.TestDelete( context.TODO(), diff --git a/seed/go-sdk/exhaustive/no-custom-config/endpoints/object/endpoints_object_test/endpoints_object_test.go b/seed/go-sdk/exhaustive/no-custom-config/endpoints/object/endpoints_object_test/endpoints_object_test.go index 81fa5d6325b8..96a052d26a9c 100644 --- a/seed/go-sdk/exhaustive/no-custom-config/endpoints/object/endpoints_object_test/endpoints_object_test.go +++ b/seed/go-sdk/exhaustive/no-custom-config/endpoints/object/endpoints_object_test/endpoints_object_test.go @@ -74,6 +74,7 @@ func TestEndpointsObjectGetAndReturnWithOptionalFieldWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &types.ObjectWithOptionalField{ FieldString: fern.String( @@ -144,6 +145,7 @@ func TestEndpointsObjectGetAndReturnWithRequiredFieldWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &types.ObjectWithRequiredField{ FieldString: "string", @@ -169,6 +171,7 @@ func TestEndpointsObjectGetAndReturnWithMapOfMapWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &types.ObjectWithMapOfMap{ Map: map[string]map[string]string{ @@ -198,6 +201,7 @@ func TestEndpointsObjectGetAndReturnNestedWithOptionalFieldWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &types.NestedObjectWithOptionalField{ FieldString: fern.String( @@ -273,6 +277,7 @@ func TestEndpointsObjectGetAndReturnNestedWithRequiredFieldWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &types.NestedObjectWithRequiredField{ FieldString: "string", @@ -347,6 +352,7 @@ func TestEndpointsObjectGetAndReturnNestedWithRequiredFieldAsListWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := []*types.NestedObjectWithRequiredField{ &types.NestedObjectWithRequiredField{ @@ -473,6 +479,7 @@ func TestEndpointsObjectGetAndReturnWithUnknownFieldWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &types.ObjectWithUnknownField{ Unknown: map[string]any{ @@ -500,6 +507,7 @@ func TestEndpointsObjectGetAndReturnWithDocumentedUnknownTypeWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &types.ObjectWithDocumentedUnknownType{ DocumentedUnknownType: map[string]any{ @@ -527,6 +535,7 @@ func TestEndpointsObjectGetAndReturnMapOfDocumentedUnknownTypeWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := map[string]types.DocumentedUnknownType{ "string": map[string]any{ @@ -554,6 +563,7 @@ func TestEndpointsObjectGetAndReturnWithDatetimeLikeStringWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &types.ObjectWithDatetimeLikeString{ DatetimeLikeString: "2023-08-31T14:15:22Z", diff --git a/seed/go-sdk/exhaustive/no-custom-config/endpoints/pagination/endpoints_pagination_test/endpoints_pagination_test.go b/seed/go-sdk/exhaustive/no-custom-config/endpoints/pagination/endpoints_pagination_test/endpoints_pagination_test.go index 068f19836c9d..6b1db87b1190 100644 --- a/seed/go-sdk/exhaustive/no-custom-config/endpoints/pagination/endpoints_pagination_test/endpoints_pagination_test.go +++ b/seed/go-sdk/exhaustive/no-custom-config/endpoints/pagination/endpoints_pagination_test/endpoints_pagination_test.go @@ -73,6 +73,7 @@ func TestEndpointsPaginationListItemsWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &endpoints.ListItemsRequest{ Cursor: fern.String( diff --git a/seed/go-sdk/exhaustive/no-custom-config/endpoints/params/endpoints_params_test/endpoints_params_test.go b/seed/go-sdk/exhaustive/no-custom-config/endpoints/params/endpoints_params_test/endpoints_params_test.go index 94a4fe9c539a..d18753170f42 100644 --- a/seed/go-sdk/exhaustive/no-custom-config/endpoints/params/endpoints_params_test/endpoints_params_test.go +++ b/seed/go-sdk/exhaustive/no-custom-config/endpoints/params/endpoints_params_test/endpoints_params_test.go @@ -72,6 +72,7 @@ func TestEndpointsParamsGetWithPathWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) _, invocationErr := client.Endpoints.Params.GetWithPath( context.TODO(), @@ -94,6 +95,7 @@ func TestEndpointsParamsGetWithPathWithWireMock2( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) _, invocationErr := client.Endpoints.Params.GetWithPath( context.TODO(), @@ -116,6 +118,7 @@ func TestEndpointsParamsGetWithQueryWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &endpoints.GetWithQuery{ Query: "query", @@ -142,6 +145,7 @@ func TestEndpointsParamsGetWithQueryWithWireMock2( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &endpoints.GetWithQuery{ Query: "query", @@ -168,6 +172,7 @@ func TestEndpointsParamsGetWithPathAndQueryWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &endpoints.GetWithPathAndQuery{ Query: "query", @@ -194,6 +199,7 @@ func TestEndpointsParamsGetWithPathAndQueryWithWireMock2( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &endpoints.GetWithPathAndQuery{ Query: "query", @@ -220,6 +226,7 @@ func TestEndpointsParamsModifyWithPathWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := "string" _, invocationErr := client.Endpoints.Params.ModifyWithPath( @@ -244,6 +251,7 @@ func TestEndpointsParamsModifyWithPathWithWireMock2( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := "string" _, invocationErr := client.Endpoints.Params.ModifyWithPath( @@ -268,6 +276,7 @@ func TestEndpointsParamsGetWithPathWithWireMock3( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) _, invocationErr := client.Endpoints.Params.GetWithPath( context.TODO(), diff --git a/seed/go-sdk/exhaustive/no-custom-config/endpoints/primitive/endpoints_primitive_test/endpoints_primitive_test.go b/seed/go-sdk/exhaustive/no-custom-config/endpoints/primitive/endpoints_primitive_test/endpoints_primitive_test.go index 1a8ebbf56f85..a92fa3433432 100644 --- a/seed/go-sdk/exhaustive/no-custom-config/endpoints/primitive/endpoints_primitive_test/endpoints_primitive_test.go +++ b/seed/go-sdk/exhaustive/no-custom-config/endpoints/primitive/endpoints_primitive_test/endpoints_primitive_test.go @@ -73,6 +73,7 @@ func TestEndpointsPrimitiveGetAndReturnStringWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := "string" _, invocationErr := client.Endpoints.Primitive.GetAndReturnString( @@ -96,6 +97,7 @@ func TestEndpointsPrimitiveGetAndReturnIntWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := 1 _, invocationErr := client.Endpoints.Primitive.GetAndReturnInt( @@ -119,6 +121,7 @@ func TestEndpointsPrimitiveGetAndReturnLongWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := int64(1000000) _, invocationErr := client.Endpoints.Primitive.GetAndReturnLong( @@ -142,6 +145,7 @@ func TestEndpointsPrimitiveGetAndReturnDoubleWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := 1.1 _, invocationErr := client.Endpoints.Primitive.GetAndReturnDouble( @@ -165,6 +169,7 @@ func TestEndpointsPrimitiveGetAndReturnBoolWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := true _, invocationErr := client.Endpoints.Primitive.GetAndReturnBool( @@ -188,6 +193,7 @@ func TestEndpointsPrimitiveGetAndReturnDatetimeWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := fern.MustParseDateTime( "2024-01-15T09:30:00Z", @@ -213,6 +219,7 @@ func TestEndpointsPrimitiveGetAndReturnUuidWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := uuid.MustParse( "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", @@ -238,6 +245,7 @@ func TestEndpointsPrimitiveGetAndReturnBase64WithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := []byte("SGVsbG8gd29ybGQh") _, invocationErr := client.Endpoints.Primitive.GetAndReturnBase64( diff --git a/seed/go-sdk/exhaustive/no-custom-config/endpoints/put/endpoints_put_test/endpoints_put_test.go b/seed/go-sdk/exhaustive/no-custom-config/endpoints/put/endpoints_put_test/endpoints_put_test.go index 599f5c9988ef..e6370862a519 100644 --- a/seed/go-sdk/exhaustive/no-custom-config/endpoints/put/endpoints_put_test/endpoints_put_test.go +++ b/seed/go-sdk/exhaustive/no-custom-config/endpoints/put/endpoints_put_test/endpoints_put_test.go @@ -72,6 +72,7 @@ func TestEndpointsPutAddWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &endpoints.PutRequest{ Id: "id", diff --git a/seed/go-sdk/exhaustive/no-custom-config/endpoints/union/endpoints_union_test/endpoints_union_test.go b/seed/go-sdk/exhaustive/no-custom-config/endpoints/union/endpoints_union_test/endpoints_union_test.go index 0c0795fb12cb..43beeeca8256 100644 --- a/seed/go-sdk/exhaustive/no-custom-config/endpoints/union/endpoints_union_test/endpoints_union_test.go +++ b/seed/go-sdk/exhaustive/no-custom-config/endpoints/union/endpoints_union_test/endpoints_union_test.go @@ -72,6 +72,7 @@ func TestEndpointsUnionGetAndReturnUnionWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &types.Animal{ Dog: &types.Dog{ diff --git a/seed/go-sdk/exhaustive/no-custom-config/endpoints/urls/endpoints_urls_test/endpoints_urls_test.go b/seed/go-sdk/exhaustive/no-custom-config/endpoints/urls/endpoints_urls_test/endpoints_urls_test.go index 529f6b54a4d4..01191c58e8db 100644 --- a/seed/go-sdk/exhaustive/no-custom-config/endpoints/urls/endpoints_urls_test/endpoints_urls_test.go +++ b/seed/go-sdk/exhaustive/no-custom-config/endpoints/urls/endpoints_urls_test/endpoints_urls_test.go @@ -71,6 +71,7 @@ func TestEndpointsUrlsWithMixedCaseWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) _, invocationErr := client.Endpoints.Urls.WithMixedCase( context.TODO(), @@ -92,6 +93,7 @@ func TestEndpointsUrlsNoEndingSlashWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) _, invocationErr := client.Endpoints.Urls.NoEndingSlash( context.TODO(), @@ -113,6 +115,7 @@ func TestEndpointsUrlsWithEndingSlashWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) _, invocationErr := client.Endpoints.Urls.WithEndingSlash( context.TODO(), @@ -134,6 +137,7 @@ func TestEndpointsUrlsWithUnderscoresWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) _, invocationErr := client.Endpoints.Urls.WithUnderscores( context.TODO(), diff --git a/seed/go-sdk/exhaustive/no-custom-config/noreqbody/no_req_body_test/no_req_body_test.go b/seed/go-sdk/exhaustive/no-custom-config/noreqbody/no_req_body_test/no_req_body_test.go index c7a1071bf8ed..ca7ae4fe287a 100644 --- a/seed/go-sdk/exhaustive/no-custom-config/noreqbody/no_req_body_test/no_req_body_test.go +++ b/seed/go-sdk/exhaustive/no-custom-config/noreqbody/no_req_body_test/no_req_body_test.go @@ -71,6 +71,7 @@ func TestNoReqBodyGetWithNoRequestBodyWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) _, invocationErr := client.NoReqBody.GetWithNoRequestBody( context.TODO(), @@ -92,6 +93,7 @@ func TestNoReqBodyPostWithNoRequestBodyWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) _, invocationErr := client.NoReqBody.PostWithNoRequestBody( context.TODO(), diff --git a/seed/go-sdk/exhaustive/no-custom-config/reqwithheaders/req_with_headers_test/req_with_headers_test.go b/seed/go-sdk/exhaustive/no-custom-config/reqwithheaders/req_with_headers_test/req_with_headers_test.go index ea557c30574a..e95b5704d405 100644 --- a/seed/go-sdk/exhaustive/no-custom-config/reqwithheaders/req_with_headers_test/req_with_headers_test.go +++ b/seed/go-sdk/exhaustive/no-custom-config/reqwithheaders/req_with_headers_test/req_with_headers_test.go @@ -72,6 +72,7 @@ func TestReqWithHeadersGetWithCustomHeaderWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &fern.ReqWithHeaders{ XTestServiceHeader: "X-TEST-SERVICE-HEADER", diff --git a/seed/go-sdk/exhaustive/omit-empty-request-wrappers/endpoints/container/endpoints_container_test/endpoints_container_test.go b/seed/go-sdk/exhaustive/omit-empty-request-wrappers/endpoints/container/endpoints_container_test/endpoints_container_test.go index 16aad0cb263b..452efec4e2a3 100644 --- a/seed/go-sdk/exhaustive/omit-empty-request-wrappers/endpoints/container/endpoints_container_test/endpoints_container_test.go +++ b/seed/go-sdk/exhaustive/omit-empty-request-wrappers/endpoints/container/endpoints_container_test/endpoints_container_test.go @@ -72,6 +72,7 @@ func TestEndpointsContainerGetAndReturnListOfPrimitivesWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := []string{ "string", @@ -98,6 +99,7 @@ func TestEndpointsContainerGetAndReturnListOfObjectsWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := []*types.ObjectWithRequiredField{ &types.ObjectWithRequiredField{ @@ -128,6 +130,7 @@ func TestEndpointsContainerGetAndReturnSetOfPrimitivesWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := []string{ "string", @@ -153,6 +156,7 @@ func TestEndpointsContainerGetAndReturnSetOfObjectsWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := []*types.ObjectWithRequiredField{ &types.ObjectWithRequiredField{ @@ -180,6 +184,7 @@ func TestEndpointsContainerGetAndReturnMapPrimToPrimWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := map[string]string{ "string": "string", @@ -205,6 +210,7 @@ func TestEndpointsContainerGetAndReturnMapOfPrimToObjectWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := map[string]*types.ObjectWithRequiredField{ "string": &types.ObjectWithRequiredField{ @@ -232,6 +238,7 @@ func TestEndpointsContainerGetAndReturnMapOfPrimToUndiscriminatedUnionWithWireMo } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := map[string]*types.MixedType{ "string": &types.MixedType{ @@ -259,6 +266,7 @@ func TestEndpointsContainerGetAndReturnOptionalWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &types.ObjectWithRequiredField{ FieldString: "string", diff --git a/seed/go-sdk/exhaustive/omit-empty-request-wrappers/endpoints/contenttype/endpoints_content_type_test/endpoints_content_type_test.go b/seed/go-sdk/exhaustive/omit-empty-request-wrappers/endpoints/contenttype/endpoints_content_type_test/endpoints_content_type_test.go index 9b12bc7c0d20..7b0e75799564 100644 --- a/seed/go-sdk/exhaustive/omit-empty-request-wrappers/endpoints/contenttype/endpoints_content_type_test/endpoints_content_type_test.go +++ b/seed/go-sdk/exhaustive/omit-empty-request-wrappers/endpoints/contenttype/endpoints_content_type_test/endpoints_content_type_test.go @@ -74,6 +74,7 @@ func TestEndpointsContentTypePostJsonPatchContentTypeWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &types.ObjectWithOptionalField{ FieldString: fern.String( @@ -144,6 +145,7 @@ func TestEndpointsContentTypePostJsonPatchContentWithCharsetTypeWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &types.ObjectWithOptionalField{ FieldString: fern.String( diff --git a/seed/go-sdk/exhaustive/omit-empty-request-wrappers/endpoints/enum/endpoints_enum_test/endpoints_enum_test.go b/seed/go-sdk/exhaustive/omit-empty-request-wrappers/endpoints/enum/endpoints_enum_test/endpoints_enum_test.go index a0d6e579190c..e2d24fd48386 100644 --- a/seed/go-sdk/exhaustive/omit-empty-request-wrappers/endpoints/enum/endpoints_enum_test/endpoints_enum_test.go +++ b/seed/go-sdk/exhaustive/omit-empty-request-wrappers/endpoints/enum/endpoints_enum_test/endpoints_enum_test.go @@ -72,6 +72,7 @@ func TestEndpointsEnumGetAndReturnEnumWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := types.WeatherReportSunny.Ptr() _, invocationErr := client.Endpoints.Enum.GetAndReturnEnum( diff --git a/seed/go-sdk/exhaustive/omit-empty-request-wrappers/endpoints/httpmethods/endpoints_http_methods_test/endpoints_http_methods_test.go b/seed/go-sdk/exhaustive/omit-empty-request-wrappers/endpoints/httpmethods/endpoints_http_methods_test/endpoints_http_methods_test.go index 20105cd5b7b4..13d253cca7ad 100644 --- a/seed/go-sdk/exhaustive/omit-empty-request-wrappers/endpoints/httpmethods/endpoints_http_methods_test/endpoints_http_methods_test.go +++ b/seed/go-sdk/exhaustive/omit-empty-request-wrappers/endpoints/httpmethods/endpoints_http_methods_test/endpoints_http_methods_test.go @@ -74,6 +74,7 @@ func TestEndpointsHttpMethodsTestGetWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) _, invocationErr := client.Endpoints.HttpMethods.TestGet( context.TODO(), @@ -96,6 +97,7 @@ func TestEndpointsHttpMethodsTestPostWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &types.ObjectWithRequiredField{ FieldString: "string", @@ -121,6 +123,7 @@ func TestEndpointsHttpMethodsTestPutWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &types.ObjectWithRequiredField{ FieldString: "string", @@ -147,6 +150,7 @@ func TestEndpointsHttpMethodsTestPatchWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &types.ObjectWithOptionalField{ FieldString: fern.String( @@ -218,6 +222,7 @@ func TestEndpointsHttpMethodsTestDeleteWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) _, invocationErr := client.Endpoints.HttpMethods.TestDelete( context.TODO(), diff --git a/seed/go-sdk/exhaustive/omit-empty-request-wrappers/endpoints/object/endpoints_object_test/endpoints_object_test.go b/seed/go-sdk/exhaustive/omit-empty-request-wrappers/endpoints/object/endpoints_object_test/endpoints_object_test.go index 81fa5d6325b8..96a052d26a9c 100644 --- a/seed/go-sdk/exhaustive/omit-empty-request-wrappers/endpoints/object/endpoints_object_test/endpoints_object_test.go +++ b/seed/go-sdk/exhaustive/omit-empty-request-wrappers/endpoints/object/endpoints_object_test/endpoints_object_test.go @@ -74,6 +74,7 @@ func TestEndpointsObjectGetAndReturnWithOptionalFieldWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &types.ObjectWithOptionalField{ FieldString: fern.String( @@ -144,6 +145,7 @@ func TestEndpointsObjectGetAndReturnWithRequiredFieldWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &types.ObjectWithRequiredField{ FieldString: "string", @@ -169,6 +171,7 @@ func TestEndpointsObjectGetAndReturnWithMapOfMapWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &types.ObjectWithMapOfMap{ Map: map[string]map[string]string{ @@ -198,6 +201,7 @@ func TestEndpointsObjectGetAndReturnNestedWithOptionalFieldWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &types.NestedObjectWithOptionalField{ FieldString: fern.String( @@ -273,6 +277,7 @@ func TestEndpointsObjectGetAndReturnNestedWithRequiredFieldWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &types.NestedObjectWithRequiredField{ FieldString: "string", @@ -347,6 +352,7 @@ func TestEndpointsObjectGetAndReturnNestedWithRequiredFieldAsListWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := []*types.NestedObjectWithRequiredField{ &types.NestedObjectWithRequiredField{ @@ -473,6 +479,7 @@ func TestEndpointsObjectGetAndReturnWithUnknownFieldWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &types.ObjectWithUnknownField{ Unknown: map[string]any{ @@ -500,6 +507,7 @@ func TestEndpointsObjectGetAndReturnWithDocumentedUnknownTypeWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &types.ObjectWithDocumentedUnknownType{ DocumentedUnknownType: map[string]any{ @@ -527,6 +535,7 @@ func TestEndpointsObjectGetAndReturnMapOfDocumentedUnknownTypeWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := map[string]types.DocumentedUnknownType{ "string": map[string]any{ @@ -554,6 +563,7 @@ func TestEndpointsObjectGetAndReturnWithDatetimeLikeStringWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &types.ObjectWithDatetimeLikeString{ DatetimeLikeString: "2023-08-31T14:15:22Z", diff --git a/seed/go-sdk/exhaustive/omit-empty-request-wrappers/endpoints/pagination/endpoints_pagination_test/endpoints_pagination_test.go b/seed/go-sdk/exhaustive/omit-empty-request-wrappers/endpoints/pagination/endpoints_pagination_test/endpoints_pagination_test.go index 068f19836c9d..6b1db87b1190 100644 --- a/seed/go-sdk/exhaustive/omit-empty-request-wrappers/endpoints/pagination/endpoints_pagination_test/endpoints_pagination_test.go +++ b/seed/go-sdk/exhaustive/omit-empty-request-wrappers/endpoints/pagination/endpoints_pagination_test/endpoints_pagination_test.go @@ -73,6 +73,7 @@ func TestEndpointsPaginationListItemsWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &endpoints.ListItemsRequest{ Cursor: fern.String( diff --git a/seed/go-sdk/exhaustive/omit-empty-request-wrappers/endpoints/params/endpoints_params_test/endpoints_params_test.go b/seed/go-sdk/exhaustive/omit-empty-request-wrappers/endpoints/params/endpoints_params_test/endpoints_params_test.go index 94a4fe9c539a..d18753170f42 100644 --- a/seed/go-sdk/exhaustive/omit-empty-request-wrappers/endpoints/params/endpoints_params_test/endpoints_params_test.go +++ b/seed/go-sdk/exhaustive/omit-empty-request-wrappers/endpoints/params/endpoints_params_test/endpoints_params_test.go @@ -72,6 +72,7 @@ func TestEndpointsParamsGetWithPathWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) _, invocationErr := client.Endpoints.Params.GetWithPath( context.TODO(), @@ -94,6 +95,7 @@ func TestEndpointsParamsGetWithPathWithWireMock2( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) _, invocationErr := client.Endpoints.Params.GetWithPath( context.TODO(), @@ -116,6 +118,7 @@ func TestEndpointsParamsGetWithQueryWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &endpoints.GetWithQuery{ Query: "query", @@ -142,6 +145,7 @@ func TestEndpointsParamsGetWithQueryWithWireMock2( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &endpoints.GetWithQuery{ Query: "query", @@ -168,6 +172,7 @@ func TestEndpointsParamsGetWithPathAndQueryWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &endpoints.GetWithPathAndQuery{ Query: "query", @@ -194,6 +199,7 @@ func TestEndpointsParamsGetWithPathAndQueryWithWireMock2( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &endpoints.GetWithPathAndQuery{ Query: "query", @@ -220,6 +226,7 @@ func TestEndpointsParamsModifyWithPathWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := "string" _, invocationErr := client.Endpoints.Params.ModifyWithPath( @@ -244,6 +251,7 @@ func TestEndpointsParamsModifyWithPathWithWireMock2( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := "string" _, invocationErr := client.Endpoints.Params.ModifyWithPath( @@ -268,6 +276,7 @@ func TestEndpointsParamsGetWithPathWithWireMock3( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) _, invocationErr := client.Endpoints.Params.GetWithPath( context.TODO(), diff --git a/seed/go-sdk/exhaustive/omit-empty-request-wrappers/endpoints/primitive/endpoints_primitive_test/endpoints_primitive_test.go b/seed/go-sdk/exhaustive/omit-empty-request-wrappers/endpoints/primitive/endpoints_primitive_test/endpoints_primitive_test.go index 1a8ebbf56f85..a92fa3433432 100644 --- a/seed/go-sdk/exhaustive/omit-empty-request-wrappers/endpoints/primitive/endpoints_primitive_test/endpoints_primitive_test.go +++ b/seed/go-sdk/exhaustive/omit-empty-request-wrappers/endpoints/primitive/endpoints_primitive_test/endpoints_primitive_test.go @@ -73,6 +73,7 @@ func TestEndpointsPrimitiveGetAndReturnStringWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := "string" _, invocationErr := client.Endpoints.Primitive.GetAndReturnString( @@ -96,6 +97,7 @@ func TestEndpointsPrimitiveGetAndReturnIntWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := 1 _, invocationErr := client.Endpoints.Primitive.GetAndReturnInt( @@ -119,6 +121,7 @@ func TestEndpointsPrimitiveGetAndReturnLongWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := int64(1000000) _, invocationErr := client.Endpoints.Primitive.GetAndReturnLong( @@ -142,6 +145,7 @@ func TestEndpointsPrimitiveGetAndReturnDoubleWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := 1.1 _, invocationErr := client.Endpoints.Primitive.GetAndReturnDouble( @@ -165,6 +169,7 @@ func TestEndpointsPrimitiveGetAndReturnBoolWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := true _, invocationErr := client.Endpoints.Primitive.GetAndReturnBool( @@ -188,6 +193,7 @@ func TestEndpointsPrimitiveGetAndReturnDatetimeWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := fern.MustParseDateTime( "2024-01-15T09:30:00Z", @@ -213,6 +219,7 @@ func TestEndpointsPrimitiveGetAndReturnUuidWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := uuid.MustParse( "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", @@ -238,6 +245,7 @@ func TestEndpointsPrimitiveGetAndReturnBase64WithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := []byte("SGVsbG8gd29ybGQh") _, invocationErr := client.Endpoints.Primitive.GetAndReturnBase64( diff --git a/seed/go-sdk/exhaustive/omit-empty-request-wrappers/endpoints/put/endpoints_put_test/endpoints_put_test.go b/seed/go-sdk/exhaustive/omit-empty-request-wrappers/endpoints/put/endpoints_put_test/endpoints_put_test.go index 599f5c9988ef..e6370862a519 100644 --- a/seed/go-sdk/exhaustive/omit-empty-request-wrappers/endpoints/put/endpoints_put_test/endpoints_put_test.go +++ b/seed/go-sdk/exhaustive/omit-empty-request-wrappers/endpoints/put/endpoints_put_test/endpoints_put_test.go @@ -72,6 +72,7 @@ func TestEndpointsPutAddWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &endpoints.PutRequest{ Id: "id", diff --git a/seed/go-sdk/exhaustive/omit-empty-request-wrappers/endpoints/union/endpoints_union_test/endpoints_union_test.go b/seed/go-sdk/exhaustive/omit-empty-request-wrappers/endpoints/union/endpoints_union_test/endpoints_union_test.go index 0c0795fb12cb..43beeeca8256 100644 --- a/seed/go-sdk/exhaustive/omit-empty-request-wrappers/endpoints/union/endpoints_union_test/endpoints_union_test.go +++ b/seed/go-sdk/exhaustive/omit-empty-request-wrappers/endpoints/union/endpoints_union_test/endpoints_union_test.go @@ -72,6 +72,7 @@ func TestEndpointsUnionGetAndReturnUnionWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &types.Animal{ Dog: &types.Dog{ diff --git a/seed/go-sdk/exhaustive/omit-empty-request-wrappers/endpoints/urls/endpoints_urls_test/endpoints_urls_test.go b/seed/go-sdk/exhaustive/omit-empty-request-wrappers/endpoints/urls/endpoints_urls_test/endpoints_urls_test.go index 529f6b54a4d4..01191c58e8db 100644 --- a/seed/go-sdk/exhaustive/omit-empty-request-wrappers/endpoints/urls/endpoints_urls_test/endpoints_urls_test.go +++ b/seed/go-sdk/exhaustive/omit-empty-request-wrappers/endpoints/urls/endpoints_urls_test/endpoints_urls_test.go @@ -71,6 +71,7 @@ func TestEndpointsUrlsWithMixedCaseWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) _, invocationErr := client.Endpoints.Urls.WithMixedCase( context.TODO(), @@ -92,6 +93,7 @@ func TestEndpointsUrlsNoEndingSlashWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) _, invocationErr := client.Endpoints.Urls.NoEndingSlash( context.TODO(), @@ -113,6 +115,7 @@ func TestEndpointsUrlsWithEndingSlashWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) _, invocationErr := client.Endpoints.Urls.WithEndingSlash( context.TODO(), @@ -134,6 +137,7 @@ func TestEndpointsUrlsWithUnderscoresWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) _, invocationErr := client.Endpoints.Urls.WithUnderscores( context.TODO(), diff --git a/seed/go-sdk/exhaustive/omit-empty-request-wrappers/noreqbody/no_req_body_test/no_req_body_test.go b/seed/go-sdk/exhaustive/omit-empty-request-wrappers/noreqbody/no_req_body_test/no_req_body_test.go index c7a1071bf8ed..ca7ae4fe287a 100644 --- a/seed/go-sdk/exhaustive/omit-empty-request-wrappers/noreqbody/no_req_body_test/no_req_body_test.go +++ b/seed/go-sdk/exhaustive/omit-empty-request-wrappers/noreqbody/no_req_body_test/no_req_body_test.go @@ -71,6 +71,7 @@ func TestNoReqBodyGetWithNoRequestBodyWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) _, invocationErr := client.NoReqBody.GetWithNoRequestBody( context.TODO(), @@ -92,6 +93,7 @@ func TestNoReqBodyPostWithNoRequestBodyWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) _, invocationErr := client.NoReqBody.PostWithNoRequestBody( context.TODO(), diff --git a/seed/go-sdk/exhaustive/omit-empty-request-wrappers/reqwithheaders/req_with_headers_test/req_with_headers_test.go b/seed/go-sdk/exhaustive/omit-empty-request-wrappers/reqwithheaders/req_with_headers_test/req_with_headers_test.go index ea557c30574a..e95b5704d405 100644 --- a/seed/go-sdk/exhaustive/omit-empty-request-wrappers/reqwithheaders/req_with_headers_test/req_with_headers_test.go +++ b/seed/go-sdk/exhaustive/omit-empty-request-wrappers/reqwithheaders/req_with_headers_test/req_with_headers_test.go @@ -72,6 +72,7 @@ func TestReqWithHeadersGetWithCustomHeaderWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &fern.ReqWithHeaders{ XTestServiceHeader: "X-TEST-SERVICE-HEADER", diff --git a/seed/go-sdk/go-deterministic-ordering/endpoints/container/endpoints_container_test/endpoints_container_test.go b/seed/go-sdk/go-deterministic-ordering/endpoints/container/endpoints_container_test/endpoints_container_test.go index 6afb6786f896..df9030127ea0 100644 --- a/seed/go-sdk/go-deterministic-ordering/endpoints/container/endpoints_container_test/endpoints_container_test.go +++ b/seed/go-sdk/go-deterministic-ordering/endpoints/container/endpoints_container_test/endpoints_container_test.go @@ -72,6 +72,7 @@ func TestEndpointsContainerGetAndReturnListOfPrimitivesWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := []string{ "string", @@ -98,6 +99,7 @@ func TestEndpointsContainerGetAndReturnListOfObjectsWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := []*types.ObjectWithRequiredField{ &types.ObjectWithRequiredField{ @@ -128,6 +130,7 @@ func TestEndpointsContainerGetAndReturnSetOfPrimitivesWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := []string{ "string", @@ -153,6 +156,7 @@ func TestEndpointsContainerGetAndReturnSetOfObjectsWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := []*types.ObjectWithRequiredField{ &types.ObjectWithRequiredField{ @@ -180,6 +184,7 @@ func TestEndpointsContainerGetAndReturnMapPrimToPrimWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := map[string]string{ "string": "string", @@ -205,6 +210,7 @@ func TestEndpointsContainerGetAndReturnMapOfPrimToObjectWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := map[string]*types.ObjectWithRequiredField{ "string": &types.ObjectWithRequiredField{ @@ -232,6 +238,7 @@ func TestEndpointsContainerGetAndReturnMapOfPrimToUndiscriminatedUnionWithWireMo } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := map[string]*types.MixedType{ "string": &types.MixedType{ @@ -259,6 +266,7 @@ func TestEndpointsContainerGetAndReturnOptionalWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &types.ObjectWithRequiredField{ FieldString: "string", diff --git a/seed/go-sdk/go-deterministic-ordering/endpoints/contenttype/endpoints_content_type_test/endpoints_content_type_test.go b/seed/go-sdk/go-deterministic-ordering/endpoints/contenttype/endpoints_content_type_test/endpoints_content_type_test.go index 2767f03cbf9c..d2bb121e688a 100644 --- a/seed/go-sdk/go-deterministic-ordering/endpoints/contenttype/endpoints_content_type_test/endpoints_content_type_test.go +++ b/seed/go-sdk/go-deterministic-ordering/endpoints/contenttype/endpoints_content_type_test/endpoints_content_type_test.go @@ -74,6 +74,7 @@ func TestEndpointsContentTypePostJsonPatchContentTypeWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &types.ObjectWithOptionalField{ FieldString: fern.String( @@ -144,6 +145,7 @@ func TestEndpointsContentTypePostJsonPatchContentWithCharsetTypeWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &types.ObjectWithOptionalField{ FieldString: fern.String( diff --git a/seed/go-sdk/go-deterministic-ordering/endpoints/duplicatenamesa/endpoints_duplicate_names_a_test/endpoints_duplicate_names_a_test.go b/seed/go-sdk/go-deterministic-ordering/endpoints/duplicatenamesa/endpoints_duplicate_names_a_test/endpoints_duplicate_names_a_test.go index 18c2ea70d777..426c5c252414 100644 --- a/seed/go-sdk/go-deterministic-ordering/endpoints/duplicatenamesa/endpoints_duplicate_names_a_test/endpoints_duplicate_names_a_test.go +++ b/seed/go-sdk/go-deterministic-ordering/endpoints/duplicatenamesa/endpoints_duplicate_names_a_test/endpoints_duplicate_names_a_test.go @@ -72,6 +72,7 @@ func TestEndpointsDuplicateNamesACreateWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &fern.CreateRequestA{ Name: "name", @@ -98,6 +99,7 @@ func TestEndpointsDuplicateNamesAGetWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &fern.GetRequestA{ Id: "id", @@ -126,6 +128,7 @@ func TestEndpointsDuplicateNamesAListWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &fern.ListRequestA{ Page: fern.Int( diff --git a/seed/go-sdk/go-deterministic-ordering/endpoints/duplicatenamesb/endpoints_duplicate_names_b_test/endpoints_duplicate_names_b_test.go b/seed/go-sdk/go-deterministic-ordering/endpoints/duplicatenamesb/endpoints_duplicate_names_b_test/endpoints_duplicate_names_b_test.go index ce78a85f7746..223e88865143 100644 --- a/seed/go-sdk/go-deterministic-ordering/endpoints/duplicatenamesb/endpoints_duplicate_names_b_test/endpoints_duplicate_names_b_test.go +++ b/seed/go-sdk/go-deterministic-ordering/endpoints/duplicatenamesb/endpoints_duplicate_names_b_test/endpoints_duplicate_names_b_test.go @@ -72,6 +72,7 @@ func TestEndpointsDuplicateNamesBCreateWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &fern.CreateRequestB{ Description: "description", @@ -98,6 +99,7 @@ func TestEndpointsDuplicateNamesBGetWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &fern.GetRequestB{ Id: "id", @@ -126,6 +128,7 @@ func TestEndpointsDuplicateNamesBListWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &fern.ListRequestB{ Cursor: fern.String( diff --git a/seed/go-sdk/go-deterministic-ordering/endpoints/duplicatenamesc/endpoints_duplicate_names_c_test/endpoints_duplicate_names_c_test.go b/seed/go-sdk/go-deterministic-ordering/endpoints/duplicatenamesc/endpoints_duplicate_names_c_test/endpoints_duplicate_names_c_test.go index f49f0738fe68..176ff6dc6dfe 100644 --- a/seed/go-sdk/go-deterministic-ordering/endpoints/duplicatenamesc/endpoints_duplicate_names_c_test/endpoints_duplicate_names_c_test.go +++ b/seed/go-sdk/go-deterministic-ordering/endpoints/duplicatenamesc/endpoints_duplicate_names_c_test/endpoints_duplicate_names_c_test.go @@ -72,6 +72,7 @@ func TestEndpointsDuplicateNamesCCreateWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &fern.CreateRequestC{ Label: "label", @@ -98,6 +99,7 @@ func TestEndpointsDuplicateNamesCGetWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &fern.GetRequestC{ Id: "id", @@ -126,6 +128,7 @@ func TestEndpointsDuplicateNamesCListWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &fern.ListRequestC{ Offset: fern.Int( diff --git a/seed/go-sdk/go-deterministic-ordering/endpoints/enum/endpoints_enum_test/endpoints_enum_test.go b/seed/go-sdk/go-deterministic-ordering/endpoints/enum/endpoints_enum_test/endpoints_enum_test.go index 1fcc979e7f3d..89c2f1e2b912 100644 --- a/seed/go-sdk/go-deterministic-ordering/endpoints/enum/endpoints_enum_test/endpoints_enum_test.go +++ b/seed/go-sdk/go-deterministic-ordering/endpoints/enum/endpoints_enum_test/endpoints_enum_test.go @@ -72,6 +72,7 @@ func TestEndpointsEnumGetAndReturnEnumWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := types.WeatherReportSunny.Ptr() _, invocationErr := client.Endpoints.Enum.GetAndReturnEnum( diff --git a/seed/go-sdk/go-deterministic-ordering/endpoints/httpmethods/endpoints_http_methods_test/endpoints_http_methods_test.go b/seed/go-sdk/go-deterministic-ordering/endpoints/httpmethods/endpoints_http_methods_test/endpoints_http_methods_test.go index 0693632a2fdb..ca403a9e1df6 100644 --- a/seed/go-sdk/go-deterministic-ordering/endpoints/httpmethods/endpoints_http_methods_test/endpoints_http_methods_test.go +++ b/seed/go-sdk/go-deterministic-ordering/endpoints/httpmethods/endpoints_http_methods_test/endpoints_http_methods_test.go @@ -74,6 +74,7 @@ func TestEndpointsHttpMethodsTestGetWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) _, invocationErr := client.Endpoints.HttpMethods.TestGet( context.TODO(), @@ -96,6 +97,7 @@ func TestEndpointsHttpMethodsTestPostWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &types.ObjectWithRequiredField{ FieldString: "string", @@ -121,6 +123,7 @@ func TestEndpointsHttpMethodsTestPutWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &types.ObjectWithRequiredField{ FieldString: "string", @@ -147,6 +150,7 @@ func TestEndpointsHttpMethodsTestPatchWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &types.ObjectWithOptionalField{ FieldString: fern.String( @@ -218,6 +222,7 @@ func TestEndpointsHttpMethodsTestDeleteWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) _, invocationErr := client.Endpoints.HttpMethods.TestDelete( context.TODO(), diff --git a/seed/go-sdk/go-deterministic-ordering/endpoints/object/endpoints_object_test/endpoints_object_test.go b/seed/go-sdk/go-deterministic-ordering/endpoints/object/endpoints_object_test/endpoints_object_test.go index 7a91a458e65c..a381c9829ba7 100644 --- a/seed/go-sdk/go-deterministic-ordering/endpoints/object/endpoints_object_test/endpoints_object_test.go +++ b/seed/go-sdk/go-deterministic-ordering/endpoints/object/endpoints_object_test/endpoints_object_test.go @@ -74,6 +74,7 @@ func TestEndpointsObjectGetAndReturnWithOptionalFieldWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &types.ObjectWithOptionalField{ FieldString: fern.String( @@ -144,6 +145,7 @@ func TestEndpointsObjectGetAndReturnWithRequiredFieldWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &types.ObjectWithRequiredField{ FieldString: "string", @@ -169,6 +171,7 @@ func TestEndpointsObjectGetAndReturnWithMapOfMapWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &types.ObjectWithMapOfMap{ Map: map[string]map[string]string{ @@ -198,6 +201,7 @@ func TestEndpointsObjectGetAndReturnNestedWithOptionalFieldWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &types.NestedObjectWithOptionalField{ FieldString: fern.String( @@ -273,6 +277,7 @@ func TestEndpointsObjectGetAndReturnNestedWithRequiredFieldWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &types.NestedObjectWithRequiredField{ FieldString: "string", @@ -347,6 +352,7 @@ func TestEndpointsObjectGetAndReturnNestedWithRequiredFieldAsListWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := []*types.NestedObjectWithRequiredField{ &types.NestedObjectWithRequiredField{ @@ -473,6 +479,7 @@ func TestEndpointsObjectGetAndReturnWithUnknownFieldWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &types.ObjectWithUnknownField{ Unknown: map[string]any{ @@ -500,6 +507,7 @@ func TestEndpointsObjectGetAndReturnWithDatetimeLikeStringWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &types.ObjectWithDatetimeLikeString{ DatetimeLikeString: "2023-08-31T14:15:22Z", diff --git a/seed/go-sdk/go-deterministic-ordering/endpoints/pagination/endpoints_pagination_test/endpoints_pagination_test.go b/seed/go-sdk/go-deterministic-ordering/endpoints/pagination/endpoints_pagination_test/endpoints_pagination_test.go index fe9d8a5ebc63..0512134d678a 100644 --- a/seed/go-sdk/go-deterministic-ordering/endpoints/pagination/endpoints_pagination_test/endpoints_pagination_test.go +++ b/seed/go-sdk/go-deterministic-ordering/endpoints/pagination/endpoints_pagination_test/endpoints_pagination_test.go @@ -72,6 +72,7 @@ func TestEndpointsPaginationListItemsWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &fern.ListItemsRequest{ Cursor: fern.String( diff --git a/seed/go-sdk/go-deterministic-ordering/endpoints/params/endpoints_params_test/endpoints_params_test.go b/seed/go-sdk/go-deterministic-ordering/endpoints/params/endpoints_params_test/endpoints_params_test.go index 5c755bf78f6a..81d3ebd9077c 100644 --- a/seed/go-sdk/go-deterministic-ordering/endpoints/params/endpoints_params_test/endpoints_params_test.go +++ b/seed/go-sdk/go-deterministic-ordering/endpoints/params/endpoints_params_test/endpoints_params_test.go @@ -72,6 +72,7 @@ func TestEndpointsParamsGetWithPathWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) _, invocationErr := client.Endpoints.Params.GetWithPath( context.TODO(), @@ -94,6 +95,7 @@ func TestEndpointsParamsGetWithPathWithWireMock2( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) _, invocationErr := client.Endpoints.Params.GetWithPath( context.TODO(), @@ -116,6 +118,7 @@ func TestEndpointsParamsGetWithQueryWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &fern.GetWithQuery{ Query: "query", @@ -142,6 +145,7 @@ func TestEndpointsParamsGetWithQueryWithWireMock2( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &fern.GetWithQuery{ Query: "query", @@ -168,6 +172,7 @@ func TestEndpointsParamsGetWithPathAndQueryWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &fern.GetWithPathAndQuery{ Query: "query", @@ -194,6 +199,7 @@ func TestEndpointsParamsGetWithPathAndQueryWithWireMock2( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &fern.GetWithPathAndQuery{ Query: "query", @@ -220,6 +226,7 @@ func TestEndpointsParamsModifyWithPathWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := "string" _, invocationErr := client.Endpoints.Params.ModifyWithPath( @@ -244,6 +251,7 @@ func TestEndpointsParamsModifyWithPathWithWireMock2( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := "string" _, invocationErr := client.Endpoints.Params.ModifyWithPath( diff --git a/seed/go-sdk/go-deterministic-ordering/endpoints/primitive/endpoints_primitive_test/endpoints_primitive_test.go b/seed/go-sdk/go-deterministic-ordering/endpoints/primitive/endpoints_primitive_test/endpoints_primitive_test.go index 305fc759ce70..1200d6fe48bc 100644 --- a/seed/go-sdk/go-deterministic-ordering/endpoints/primitive/endpoints_primitive_test/endpoints_primitive_test.go +++ b/seed/go-sdk/go-deterministic-ordering/endpoints/primitive/endpoints_primitive_test/endpoints_primitive_test.go @@ -73,6 +73,7 @@ func TestEndpointsPrimitiveGetAndReturnStringWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := "string" _, invocationErr := client.Endpoints.Primitive.GetAndReturnString( @@ -96,6 +97,7 @@ func TestEndpointsPrimitiveGetAndReturnIntWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := 1 _, invocationErr := client.Endpoints.Primitive.GetAndReturnInt( @@ -119,6 +121,7 @@ func TestEndpointsPrimitiveGetAndReturnLongWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := int64(1000000) _, invocationErr := client.Endpoints.Primitive.GetAndReturnLong( @@ -142,6 +145,7 @@ func TestEndpointsPrimitiveGetAndReturnDoubleWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := 1.1 _, invocationErr := client.Endpoints.Primitive.GetAndReturnDouble( @@ -165,6 +169,7 @@ func TestEndpointsPrimitiveGetAndReturnBoolWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := true _, invocationErr := client.Endpoints.Primitive.GetAndReturnBool( @@ -188,6 +193,7 @@ func TestEndpointsPrimitiveGetAndReturnDatetimeWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := fern.MustParseDateTime( "2024-01-15T09:30:00Z", @@ -213,6 +219,7 @@ func TestEndpointsPrimitiveGetAndReturnUuidWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := uuid.MustParse( "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", @@ -238,6 +245,7 @@ func TestEndpointsPrimitiveGetAndReturnBase64WithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := []byte("SGVsbG8gd29ybGQh") _, invocationErr := client.Endpoints.Primitive.GetAndReturnBase64( diff --git a/seed/go-sdk/go-deterministic-ordering/endpoints/put/endpoints_put_test/endpoints_put_test.go b/seed/go-sdk/go-deterministic-ordering/endpoints/put/endpoints_put_test/endpoints_put_test.go index 72c581e51016..306c96bb3382 100644 --- a/seed/go-sdk/go-deterministic-ordering/endpoints/put/endpoints_put_test/endpoints_put_test.go +++ b/seed/go-sdk/go-deterministic-ordering/endpoints/put/endpoints_put_test/endpoints_put_test.go @@ -72,6 +72,7 @@ func TestEndpointsPutAddWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &fern.PutRequest{ Id: "id", diff --git a/seed/go-sdk/go-deterministic-ordering/endpoints/union/endpoints_union_test/endpoints_union_test.go b/seed/go-sdk/go-deterministic-ordering/endpoints/union/endpoints_union_test/endpoints_union_test.go index 02c2ec6419c1..bf0d9ca9fbe8 100644 --- a/seed/go-sdk/go-deterministic-ordering/endpoints/union/endpoints_union_test/endpoints_union_test.go +++ b/seed/go-sdk/go-deterministic-ordering/endpoints/union/endpoints_union_test/endpoints_union_test.go @@ -72,6 +72,7 @@ func TestEndpointsUnionGetAndReturnUnionWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &types.Animal{ Dog: &types.Dog{ diff --git a/seed/go-sdk/go-deterministic-ordering/endpoints/urls/endpoints_urls_test/endpoints_urls_test.go b/seed/go-sdk/go-deterministic-ordering/endpoints/urls/endpoints_urls_test/endpoints_urls_test.go index 444a4a2649f9..634277e48c32 100644 --- a/seed/go-sdk/go-deterministic-ordering/endpoints/urls/endpoints_urls_test/endpoints_urls_test.go +++ b/seed/go-sdk/go-deterministic-ordering/endpoints/urls/endpoints_urls_test/endpoints_urls_test.go @@ -71,6 +71,7 @@ func TestEndpointsUrlsWithMixedCaseWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) _, invocationErr := client.Endpoints.Urls.WithMixedCase( context.TODO(), @@ -92,6 +93,7 @@ func TestEndpointsUrlsNoEndingSlashWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) _, invocationErr := client.Endpoints.Urls.NoEndingSlash( context.TODO(), @@ -113,6 +115,7 @@ func TestEndpointsUrlsWithEndingSlashWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) _, invocationErr := client.Endpoints.Urls.WithEndingSlash( context.TODO(), @@ -134,6 +137,7 @@ func TestEndpointsUrlsWithUnderscoresWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) _, invocationErr := client.Endpoints.Urls.WithUnderscores( context.TODO(), diff --git a/seed/go-sdk/go-deterministic-ordering/noreqbody/no_req_body_test/no_req_body_test.go b/seed/go-sdk/go-deterministic-ordering/noreqbody/no_req_body_test/no_req_body_test.go index 80f9b1390b04..d7e2c2f3523c 100644 --- a/seed/go-sdk/go-deterministic-ordering/noreqbody/no_req_body_test/no_req_body_test.go +++ b/seed/go-sdk/go-deterministic-ordering/noreqbody/no_req_body_test/no_req_body_test.go @@ -71,6 +71,7 @@ func TestNoReqBodyGetWithNoRequestBodyWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) _, invocationErr := client.NoReqBody.GetWithNoRequestBody( context.TODO(), @@ -92,6 +93,7 @@ func TestNoReqBodyPostWithNoRequestBodyWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) _, invocationErr := client.NoReqBody.PostWithNoRequestBody( context.TODO(), diff --git a/seed/go-sdk/go-deterministic-ordering/reqwithheaders/req_with_headers_test/req_with_headers_test.go b/seed/go-sdk/go-deterministic-ordering/reqwithheaders/req_with_headers_test/req_with_headers_test.go index 193c0aa9b9ff..dafbd55e63aa 100644 --- a/seed/go-sdk/go-deterministic-ordering/reqwithheaders/req_with_headers_test/req_with_headers_test.go +++ b/seed/go-sdk/go-deterministic-ordering/reqwithheaders/req_with_headers_test/req_with_headers_test.go @@ -72,6 +72,7 @@ func TestReqWithHeadersGetWithCustomHeaderWithWireMock( } client := client.NewClient( option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), ) request := &fern.ReqWithHeaders{ XTestServiceHeader: "X-TEST-SERVICE-HEADER", diff --git a/seed/go-sdk/null-type/conversations.go b/seed/go-sdk/null-type/conversations.go index 885e9f2e573a..61f6f1583eda 100644 --- a/seed/go-sdk/null-type/conversations.go +++ b/seed/go-sdk/null-type/conversations.go @@ -68,15 +68,17 @@ func (o *OutboundCallConversationsRequest) MarshalJSON() ([]byte, error) { var ( outboundCallConversationsResponseFieldConversationId = big.NewInt(1 << 0) + outboundCallConversationsResponseFieldDryRun = big.NewInt(1 << 1) ) type OutboundCallConversationsResponse struct { // Always null when dry_run is true. ConversationId any `json:"conversation_id,omitempty" url:"conversation_id,omitempty"` + // Always true for this response. + DryRun bool `json:"dry_run" url:"dry_run"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` - dryRun bool extraProperties map[string]interface{} rawJSON json.RawMessage @@ -89,8 +91,11 @@ func (o *OutboundCallConversationsResponse) GetConversationId() any { return o.ConversationId } -func (o *OutboundCallConversationsResponse) DryRun() bool { - return o.dryRun +func (o *OutboundCallConversationsResponse) GetDryRun() bool { + if o == nil { + return false + } + return o.DryRun } func (o *OutboundCallConversationsResponse) GetExtraProperties() map[string]interface{} { @@ -114,23 +119,21 @@ func (o *OutboundCallConversationsResponse) SetConversationId(conversationId any o.require(outboundCallConversationsResponseFieldConversationId) } +// SetDryRun sets the DryRun field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OutboundCallConversationsResponse) SetDryRun(dryRun bool) { + o.DryRun = dryRun + o.require(outboundCallConversationsResponseFieldDryRun) +} + func (o *OutboundCallConversationsResponse) UnmarshalJSON(data []byte) error { - type embed OutboundCallConversationsResponse - var unmarshaler = struct { - embed - DryRun bool `json:"dry_run"` - }{ - embed: embed(*o), - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { + type unmarshaler OutboundCallConversationsResponse + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { return err } - *o = OutboundCallConversationsResponse(unmarshaler.embed) - if unmarshaler.DryRun != true { - return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", o, true, unmarshaler.DryRun) - } - o.dryRun = unmarshaler.DryRun - extraProperties, err := internal.ExtractExtraProperties(data, *o, "dry_run") + *o = OutboundCallConversationsResponse(value) + extraProperties, err := internal.ExtractExtraProperties(data, *o) if err != nil { return err } @@ -143,10 +146,8 @@ func (o *OutboundCallConversationsResponse) MarshalJSON() ([]byte, error) { type embed OutboundCallConversationsResponse var marshaler = struct { embed - DryRun bool `json:"dry_run"` }{ - embed: embed(*o), - DryRun: true, + embed: embed(*o), } explicitMarshaler := internal.HandleExplicitFields(marshaler, o.explicitFields) return json.Marshal(explicitMarshaler) diff --git a/seed/go-sdk/null-type/conversations_test.go b/seed/go-sdk/null-type/conversations_test.go index 97974733c734..828c7cc5c762 100644 --- a/seed/go-sdk/null-type/conversations_test.go +++ b/seed/go-sdk/null-type/conversations_test.go @@ -102,6 +102,14 @@ func TestSettersOutboundCallConversationsResponse(t *testing.T) { assert.NotNil(t, obj.explicitFields) }) + t.Run("SetDryRun", func(t *testing.T) { + obj := &OutboundCallConversationsResponse{} + var fernTestValueDryRun bool + obj.SetDryRun(fernTestValueDryRun) + assert.Equal(t, fernTestValueDryRun, obj.DryRun) + assert.NotNil(t, obj.explicitFields) + }) + } func TestGettersOutboundCallConversationsResponse(t *testing.T) { @@ -128,6 +136,29 @@ func TestGettersOutboundCallConversationsResponse(t *testing.T) { _ = obj.GetConversationId() // Should return zero value }) + t.Run("GetDryRun", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &OutboundCallConversationsResponse{} + var expected bool + obj.DryRun = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetDryRun(), "getter should return the property value") + }) + + t.Run("GetDryRun_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *OutboundCallConversationsResponse + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetDryRun() // Should return zero value + }) + } func TestSettersMarkExplicitOutboundCallConversationsResponse(t *testing.T) { @@ -162,6 +193,37 @@ func TestSettersMarkExplicitOutboundCallConversationsResponse(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) + t.Run("SetDryRun_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &OutboundCallConversationsResponse{} + var fernTestValueDryRun bool + + // Act + obj.SetDryRun(fernTestValueDryRun) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + } func TestJSONMarshalingOutboundCallConversationsResponse(t *testing.T) { @@ -189,6 +251,12 @@ func TestJSONMarshalingOutboundCallConversationsResponse(t *testing.T) { assert.Error(t, err, "unmarshaling invalid JSON should return an error") }) + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj OutboundCallConversationsResponse + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) } func TestStringOutboundCallConversationsResponse(t *testing.T) { diff --git a/seed/go-sdk/seed.yml b/seed/go-sdk/seed.yml index 96930596c6b9..0f397429d735 100644 --- a/seed/go-sdk/seed.yml +++ b/seed/go-sdk/seed.yml @@ -368,4 +368,5 @@ allowedFailures: - file-upload:package-name - file-upload-openapi - # exhaustive fixtures now pass after fixing bytes endpoint wire test generation + - go-deterministic-ordering:. + - exhaustive:omit-empty-request-wrappers diff --git a/seed/java-sdk/unions-with-local-date/default/reference.md b/seed/java-sdk/unions-with-local-date/default/reference.md index 16501d4a4e1c..043a7a3eecee 100644 --- a/seed/java-sdk/unions-with-local-date/default/reference.md +++ b/seed/java-sdk/unions-with-local-date/default/reference.md @@ -58,6 +58,9 @@ client.bigunion().update( NormalSweet .builder() .value("value") + .additionalProperty("id", "id") + .additionalProperty("created-at", "2024-01-15T09:30:00Z") + .additionalProperty("archived-at", "2024-01-15T09:30:00Z") .build() ) ); @@ -106,12 +109,18 @@ client.bigunion().updateMany( NormalSweet .builder() .value("value") + .additionalProperty("id", "id") + .additionalProperty("created-at", "2024-01-15T09:30:00Z") + .additionalProperty("archived-at", "2024-01-15T09:30:00Z") .build() ), BigUnion.normalSweet( NormalSweet .builder() .value("value") + .additionalProperty("id", "id") + .additionalProperty("created-at", "2024-01-15T09:30:00Z") + .additionalProperty("archived-at", "2024-01-15T09:30:00Z") .build() ) ) @@ -284,6 +293,7 @@ client.union().update( Circle .builder() .radius(1.1) + .additionalProperty("id", "id") .build() ) ); diff --git a/seed/java-sdk/unions-with-local-date/default/snippet.json b/seed/java-sdk/unions-with-local-date/default/snippet.json index a642bedad37d..ed0259f960c4 100644 --- a/seed/java-sdk/unions-with-local-date/default/snippet.json +++ b/seed/java-sdk/unions-with-local-date/default/snippet.json @@ -22,8 +22,8 @@ }, "snippet": { "type": "java", - "sync_client": "package com.example.usage;\n\nimport com.seed.unions.SeedUnionsClient;\nimport com.seed.unions.resources.bigunion.types.BigUnion;\nimport com.seed.unions.resources.bigunion.types.NormalSweet;\n\npublic class Example {\n public static void main(String[] args) {\n SeedUnionsClient client = SeedUnionsClient\n .builder()\n .build();\n\n client.bigunion().update(\n BigUnion.normalSweet(\n NormalSweet\n .builder()\n .value(\"value\")\n .build()\n )\n );\n }\n}\n", - "async_client": "package com.example.usage;\n\nimport com.seed.unions.SeedUnionsClient;\nimport com.seed.unions.resources.bigunion.types.BigUnion;\nimport com.seed.unions.resources.bigunion.types.NormalSweet;\n\npublic class Example {\n public static void main(String[] args) {\n SeedUnionsClient client = SeedUnionsClient\n .builder()\n .build();\n\n client.bigunion().update(\n BigUnion.normalSweet(\n NormalSweet\n .builder()\n .value(\"value\")\n .build()\n )\n );\n }\n}\n" + "sync_client": "package com.example.usage;\n\nimport com.seed.unions.SeedUnionsClient;\nimport com.seed.unions.resources.bigunion.types.BigUnion;\nimport com.seed.unions.resources.bigunion.types.NormalSweet;\n\npublic class Example {\n public static void main(String[] args) {\n SeedUnionsClient client = SeedUnionsClient\n .builder()\n .build();\n\n client.bigunion().update(\n BigUnion.normalSweet(\n NormalSweet\n .builder()\n .value(\"value\")\n .additionalProperty(\"id\", \"id\")\n .additionalProperty(\"created-at\", \"2024-01-15T09:30:00Z\")\n .additionalProperty(\"archived-at\", \"2024-01-15T09:30:00Z\")\n .build()\n )\n );\n }\n}\n", + "async_client": "package com.example.usage;\n\nimport com.seed.unions.SeedUnionsClient;\nimport com.seed.unions.resources.bigunion.types.BigUnion;\nimport com.seed.unions.resources.bigunion.types.NormalSweet;\n\npublic class Example {\n public static void main(String[] args) {\n SeedUnionsClient client = SeedUnionsClient\n .builder()\n .build();\n\n client.bigunion().update(\n BigUnion.normalSweet(\n NormalSweet\n .builder()\n .value(\"value\")\n .additionalProperty(\"id\", \"id\")\n .additionalProperty(\"created-at\", \"2024-01-15T09:30:00Z\")\n .additionalProperty(\"archived-at\", \"2024-01-15T09:30:00Z\")\n .build()\n )\n );\n }\n}\n" } }, { @@ -35,8 +35,8 @@ }, "snippet": { "type": "java", - "sync_client": "package com.example.usage;\n\nimport com.seed.unions.SeedUnionsClient;\nimport com.seed.unions.resources.bigunion.types.BigUnion;\nimport com.seed.unions.resources.bigunion.types.NormalSweet;\nimport java.util.Arrays;\n\npublic class Example {\n public static void main(String[] args) {\n SeedUnionsClient client = SeedUnionsClient\n .builder()\n .build();\n\n client.bigunion().updateMany(\n Arrays.asList(\n BigUnion.normalSweet(\n NormalSweet\n .builder()\n .value(\"value\")\n .build()\n ),\n BigUnion.normalSweet(\n NormalSweet\n .builder()\n .value(\"value\")\n .build()\n )\n )\n );\n }\n}\n", - "async_client": "package com.example.usage;\n\nimport com.seed.unions.SeedUnionsClient;\nimport com.seed.unions.resources.bigunion.types.BigUnion;\nimport com.seed.unions.resources.bigunion.types.NormalSweet;\nimport java.util.Arrays;\n\npublic class Example {\n public static void main(String[] args) {\n SeedUnionsClient client = SeedUnionsClient\n .builder()\n .build();\n\n client.bigunion().updateMany(\n Arrays.asList(\n BigUnion.normalSweet(\n NormalSweet\n .builder()\n .value(\"value\")\n .build()\n ),\n BigUnion.normalSweet(\n NormalSweet\n .builder()\n .value(\"value\")\n .build()\n )\n )\n );\n }\n}\n" + "sync_client": "package com.example.usage;\n\nimport com.seed.unions.SeedUnionsClient;\nimport com.seed.unions.resources.bigunion.types.BigUnion;\nimport com.seed.unions.resources.bigunion.types.NormalSweet;\nimport java.util.Arrays;\n\npublic class Example {\n public static void main(String[] args) {\n SeedUnionsClient client = SeedUnionsClient\n .builder()\n .build();\n\n client.bigunion().updateMany(\n Arrays.asList(\n BigUnion.normalSweet(\n NormalSweet\n .builder()\n .value(\"value\")\n .additionalProperty(\"id\", \"id\")\n .additionalProperty(\"created-at\", \"2024-01-15T09:30:00Z\")\n .additionalProperty(\"archived-at\", \"2024-01-15T09:30:00Z\")\n .build()\n ),\n BigUnion.normalSweet(\n NormalSweet\n .builder()\n .value(\"value\")\n .additionalProperty(\"id\", \"id\")\n .additionalProperty(\"created-at\", \"2024-01-15T09:30:00Z\")\n .additionalProperty(\"archived-at\", \"2024-01-15T09:30:00Z\")\n .build()\n )\n )\n );\n }\n}\n", + "async_client": "package com.example.usage;\n\nimport com.seed.unions.SeedUnionsClient;\nimport com.seed.unions.resources.bigunion.types.BigUnion;\nimport com.seed.unions.resources.bigunion.types.NormalSweet;\nimport java.util.Arrays;\n\npublic class Example {\n public static void main(String[] args) {\n SeedUnionsClient client = SeedUnionsClient\n .builder()\n .build();\n\n client.bigunion().updateMany(\n Arrays.asList(\n BigUnion.normalSweet(\n NormalSweet\n .builder()\n .value(\"value\")\n .additionalProperty(\"id\", \"id\")\n .additionalProperty(\"created-at\", \"2024-01-15T09:30:00Z\")\n .additionalProperty(\"archived-at\", \"2024-01-15T09:30:00Z\")\n .build()\n ),\n BigUnion.normalSweet(\n NormalSweet\n .builder()\n .value(\"value\")\n .additionalProperty(\"id\", \"id\")\n .additionalProperty(\"created-at\", \"2024-01-15T09:30:00Z\")\n .additionalProperty(\"archived-at\", \"2024-01-15T09:30:00Z\")\n .build()\n )\n )\n );\n }\n}\n" } }, { @@ -139,8 +139,8 @@ }, "snippet": { "type": "java", - "sync_client": "package com.example.usage;\n\nimport com.seed.unions.SeedUnionsClient;\nimport com.seed.unions.resources.union.types.Circle;\nimport com.seed.unions.resources.union.types.Shape;\n\npublic class Example {\n public static void main(String[] args) {\n SeedUnionsClient client = SeedUnionsClient\n .builder()\n .build();\n\n client.union().update(\n Shape.circle(\n Circle\n .builder()\n .radius(1.1)\n .build()\n )\n );\n }\n}\n", - "async_client": "package com.example.usage;\n\nimport com.seed.unions.SeedUnionsClient;\nimport com.seed.unions.resources.union.types.Circle;\nimport com.seed.unions.resources.union.types.Shape;\n\npublic class Example {\n public static void main(String[] args) {\n SeedUnionsClient client = SeedUnionsClient\n .builder()\n .build();\n\n client.union().update(\n Shape.circle(\n Circle\n .builder()\n .radius(1.1)\n .build()\n )\n );\n }\n}\n" + "sync_client": "package com.example.usage;\n\nimport com.seed.unions.SeedUnionsClient;\nimport com.seed.unions.resources.union.types.Circle;\nimport com.seed.unions.resources.union.types.Shape;\n\npublic class Example {\n public static void main(String[] args) {\n SeedUnionsClient client = SeedUnionsClient\n .builder()\n .build();\n\n client.union().update(\n Shape.circle(\n Circle\n .builder()\n .radius(1.1)\n .additionalProperty(\"id\", \"id\")\n .build()\n )\n );\n }\n}\n", + "async_client": "package com.example.usage;\n\nimport com.seed.unions.SeedUnionsClient;\nimport com.seed.unions.resources.union.types.Circle;\nimport com.seed.unions.resources.union.types.Shape;\n\npublic class Example {\n public static void main(String[] args) {\n SeedUnionsClient client = SeedUnionsClient\n .builder()\n .build();\n\n client.union().update(\n Shape.circle(\n Circle\n .builder()\n .radius(1.1)\n .additionalProperty(\"id\", \"id\")\n .build()\n )\n );\n }\n}\n" } } ], diff --git a/seed/java-sdk/unions-with-local-date/default/src/main/java/com/snippets/Example1.java b/seed/java-sdk/unions-with-local-date/default/src/main/java/com/snippets/Example1.java index 012001485ab4..94b247236465 100644 --- a/seed/java-sdk/unions-with-local-date/default/src/main/java/com/snippets/Example1.java +++ b/seed/java-sdk/unions-with-local-date/default/src/main/java/com/snippets/Example1.java @@ -10,7 +10,11 @@ public static void main(String[] args) { SeedUnionsClient.builder().url("https://api.fern.com").build(); client.bigunion() - .update(BigUnion.normalSweet( - NormalSweet.builder().value("value").build())); + .update(BigUnion.normalSweet(NormalSweet.builder() + .value("value") + .additionalProperty("id", "id") + .additionalProperty("created-at", "2024-01-15T09:30:00Z") + .additionalProperty("archived-at", "2024-01-15T09:30:00Z") + .build())); } } diff --git a/seed/java-sdk/unions-with-local-date/default/src/main/java/com/snippets/Example10.java b/seed/java-sdk/unions-with-local-date/default/src/main/java/com/snippets/Example10.java index 9b5b3a4e6b49..895c13956c13 100644 --- a/seed/java-sdk/unions-with-local-date/default/src/main/java/com/snippets/Example10.java +++ b/seed/java-sdk/unions-with-local-date/default/src/main/java/com/snippets/Example10.java @@ -9,6 +9,10 @@ public static void main(String[] args) { SeedUnionsClient client = SeedUnionsClient.builder().url("https://api.fern.com").build(); - client.union().update(Shape.circle(Circle.builder().radius(1.1).build())); + client.union() + .update(Shape.circle(Circle.builder() + .radius(1.1) + .additionalProperty("id", "id") + .build())); } } diff --git a/seed/java-sdk/unions-with-local-date/default/src/main/java/com/snippets/Example2.java b/seed/java-sdk/unions-with-local-date/default/src/main/java/com/snippets/Example2.java index 1528c974f238..8fe23290520d 100644 --- a/seed/java-sdk/unions-with-local-date/default/src/main/java/com/snippets/Example2.java +++ b/seed/java-sdk/unions-with-local-date/default/src/main/java/com/snippets/Example2.java @@ -12,9 +12,17 @@ public static void main(String[] args) { client.bigunion() .updateMany(Arrays.asList( - BigUnion.normalSweet( - NormalSweet.builder().value("value").build()), - BigUnion.normalSweet( - NormalSweet.builder().value("value").build()))); + BigUnion.normalSweet(NormalSweet.builder() + .value("value") + .additionalProperty("id", "id") + .additionalProperty("created-at", "2024-01-15T09:30:00Z") + .additionalProperty("archived-at", "2024-01-15T09:30:00Z") + .build()), + BigUnion.normalSweet(NormalSweet.builder() + .value("value") + .additionalProperty("id", "id") + .additionalProperty("created-at", "2024-01-15T09:30:00Z") + .additionalProperty("archived-at", "2024-01-15T09:30:00Z") + .build()))); } } diff --git a/seed/java-sdk/unions/default/reference.md b/seed/java-sdk/unions/default/reference.md index 5ac3726a0146..3e51f304235f 100644 --- a/seed/java-sdk/unions/default/reference.md +++ b/seed/java-sdk/unions/default/reference.md @@ -58,6 +58,9 @@ client.bigunion().update( NormalSweet .builder() .value("value") + .additionalProperty("id", "id") + .additionalProperty("created-at", "2024-01-15T09:30:00Z") + .additionalProperty("archived-at", "2024-01-15T09:30:00Z") .build() ) ); @@ -106,12 +109,18 @@ client.bigunion().updateMany( NormalSweet .builder() .value("value") + .additionalProperty("id", "id") + .additionalProperty("created-at", "2024-01-15T09:30:00Z") + .additionalProperty("archived-at", "2024-01-15T09:30:00Z") .build() ), BigUnion.normalSweet( NormalSweet .builder() .value("value") + .additionalProperty("id", "id") + .additionalProperty("created-at", "2024-01-15T09:30:00Z") + .additionalProperty("archived-at", "2024-01-15T09:30:00Z") .build() ) ) @@ -201,6 +210,7 @@ client.union().update( Circle .builder() .radius(1.1) + .additionalProperty("id", "id") .build() ) ); diff --git a/seed/java-sdk/unions/default/snippet.json b/seed/java-sdk/unions/default/snippet.json index b766cdfd018a..9c2ba91282bf 100644 --- a/seed/java-sdk/unions/default/snippet.json +++ b/seed/java-sdk/unions/default/snippet.json @@ -22,8 +22,8 @@ }, "snippet": { "type": "java", - "sync_client": "package com.example.usage;\n\nimport com.seed.unions.SeedUnionsClient;\nimport com.seed.unions.resources.bigunion.types.BigUnion;\nimport com.seed.unions.resources.bigunion.types.NormalSweet;\n\npublic class Example {\n public static void main(String[] args) {\n SeedUnionsClient client = SeedUnionsClient\n .builder()\n .build();\n\n client.bigunion().update(\n BigUnion.normalSweet(\n NormalSweet\n .builder()\n .value(\"value\")\n .build()\n )\n );\n }\n}\n", - "async_client": "package com.example.usage;\n\nimport com.seed.unions.SeedUnionsClient;\nimport com.seed.unions.resources.bigunion.types.BigUnion;\nimport com.seed.unions.resources.bigunion.types.NormalSweet;\n\npublic class Example {\n public static void main(String[] args) {\n SeedUnionsClient client = SeedUnionsClient\n .builder()\n .build();\n\n client.bigunion().update(\n BigUnion.normalSweet(\n NormalSweet\n .builder()\n .value(\"value\")\n .build()\n )\n );\n }\n}\n" + "sync_client": "package com.example.usage;\n\nimport com.seed.unions.SeedUnionsClient;\nimport com.seed.unions.resources.bigunion.types.BigUnion;\nimport com.seed.unions.resources.bigunion.types.NormalSweet;\n\npublic class Example {\n public static void main(String[] args) {\n SeedUnionsClient client = SeedUnionsClient\n .builder()\n .build();\n\n client.bigunion().update(\n BigUnion.normalSweet(\n NormalSweet\n .builder()\n .value(\"value\")\n .additionalProperty(\"id\", \"id\")\n .additionalProperty(\"created-at\", \"2024-01-15T09:30:00Z\")\n .additionalProperty(\"archived-at\", \"2024-01-15T09:30:00Z\")\n .build()\n )\n );\n }\n}\n", + "async_client": "package com.example.usage;\n\nimport com.seed.unions.SeedUnionsClient;\nimport com.seed.unions.resources.bigunion.types.BigUnion;\nimport com.seed.unions.resources.bigunion.types.NormalSweet;\n\npublic class Example {\n public static void main(String[] args) {\n SeedUnionsClient client = SeedUnionsClient\n .builder()\n .build();\n\n client.bigunion().update(\n BigUnion.normalSweet(\n NormalSweet\n .builder()\n .value(\"value\")\n .additionalProperty(\"id\", \"id\")\n .additionalProperty(\"created-at\", \"2024-01-15T09:30:00Z\")\n .additionalProperty(\"archived-at\", \"2024-01-15T09:30:00Z\")\n .build()\n )\n );\n }\n}\n" } }, { @@ -35,8 +35,8 @@ }, "snippet": { "type": "java", - "sync_client": "package com.example.usage;\n\nimport com.seed.unions.SeedUnionsClient;\nimport com.seed.unions.resources.bigunion.types.BigUnion;\nimport com.seed.unions.resources.bigunion.types.NormalSweet;\nimport java.util.Arrays;\n\npublic class Example {\n public static void main(String[] args) {\n SeedUnionsClient client = SeedUnionsClient\n .builder()\n .build();\n\n client.bigunion().updateMany(\n Arrays.asList(\n BigUnion.normalSweet(\n NormalSweet\n .builder()\n .value(\"value\")\n .build()\n ),\n BigUnion.normalSweet(\n NormalSweet\n .builder()\n .value(\"value\")\n .build()\n )\n )\n );\n }\n}\n", - "async_client": "package com.example.usage;\n\nimport com.seed.unions.SeedUnionsClient;\nimport com.seed.unions.resources.bigunion.types.BigUnion;\nimport com.seed.unions.resources.bigunion.types.NormalSweet;\nimport java.util.Arrays;\n\npublic class Example {\n public static void main(String[] args) {\n SeedUnionsClient client = SeedUnionsClient\n .builder()\n .build();\n\n client.bigunion().updateMany(\n Arrays.asList(\n BigUnion.normalSweet(\n NormalSweet\n .builder()\n .value(\"value\")\n .build()\n ),\n BigUnion.normalSweet(\n NormalSweet\n .builder()\n .value(\"value\")\n .build()\n )\n )\n );\n }\n}\n" + "sync_client": "package com.example.usage;\n\nimport com.seed.unions.SeedUnionsClient;\nimport com.seed.unions.resources.bigunion.types.BigUnion;\nimport com.seed.unions.resources.bigunion.types.NormalSweet;\nimport java.util.Arrays;\n\npublic class Example {\n public static void main(String[] args) {\n SeedUnionsClient client = SeedUnionsClient\n .builder()\n .build();\n\n client.bigunion().updateMany(\n Arrays.asList(\n BigUnion.normalSweet(\n NormalSweet\n .builder()\n .value(\"value\")\n .additionalProperty(\"id\", \"id\")\n .additionalProperty(\"created-at\", \"2024-01-15T09:30:00Z\")\n .additionalProperty(\"archived-at\", \"2024-01-15T09:30:00Z\")\n .build()\n ),\n BigUnion.normalSweet(\n NormalSweet\n .builder()\n .value(\"value\")\n .additionalProperty(\"id\", \"id\")\n .additionalProperty(\"created-at\", \"2024-01-15T09:30:00Z\")\n .additionalProperty(\"archived-at\", \"2024-01-15T09:30:00Z\")\n .build()\n )\n )\n );\n }\n}\n", + "async_client": "package com.example.usage;\n\nimport com.seed.unions.SeedUnionsClient;\nimport com.seed.unions.resources.bigunion.types.BigUnion;\nimport com.seed.unions.resources.bigunion.types.NormalSweet;\nimport java.util.Arrays;\n\npublic class Example {\n public static void main(String[] args) {\n SeedUnionsClient client = SeedUnionsClient\n .builder()\n .build();\n\n client.bigunion().updateMany(\n Arrays.asList(\n BigUnion.normalSweet(\n NormalSweet\n .builder()\n .value(\"value\")\n .additionalProperty(\"id\", \"id\")\n .additionalProperty(\"created-at\", \"2024-01-15T09:30:00Z\")\n .additionalProperty(\"archived-at\", \"2024-01-15T09:30:00Z\")\n .build()\n ),\n BigUnion.normalSweet(\n NormalSweet\n .builder()\n .value(\"value\")\n .additionalProperty(\"id\", \"id\")\n .additionalProperty(\"created-at\", \"2024-01-15T09:30:00Z\")\n .additionalProperty(\"archived-at\", \"2024-01-15T09:30:00Z\")\n .build()\n )\n )\n );\n }\n}\n" } }, { @@ -61,8 +61,8 @@ }, "snippet": { "type": "java", - "sync_client": "package com.example.usage;\n\nimport com.seed.unions.SeedUnionsClient;\nimport com.seed.unions.resources.union.types.Circle;\nimport com.seed.unions.resources.union.types.Shape;\n\npublic class Example {\n public static void main(String[] args) {\n SeedUnionsClient client = SeedUnionsClient\n .builder()\n .build();\n\n client.union().update(\n Shape.circle(\n Circle\n .builder()\n .radius(1.1)\n .build()\n )\n );\n }\n}\n", - "async_client": "package com.example.usage;\n\nimport com.seed.unions.SeedUnionsClient;\nimport com.seed.unions.resources.union.types.Circle;\nimport com.seed.unions.resources.union.types.Shape;\n\npublic class Example {\n public static void main(String[] args) {\n SeedUnionsClient client = SeedUnionsClient\n .builder()\n .build();\n\n client.union().update(\n Shape.circle(\n Circle\n .builder()\n .radius(1.1)\n .build()\n )\n );\n }\n}\n" + "sync_client": "package com.example.usage;\n\nimport com.seed.unions.SeedUnionsClient;\nimport com.seed.unions.resources.union.types.Circle;\nimport com.seed.unions.resources.union.types.Shape;\n\npublic class Example {\n public static void main(String[] args) {\n SeedUnionsClient client = SeedUnionsClient\n .builder()\n .build();\n\n client.union().update(\n Shape.circle(\n Circle\n .builder()\n .radius(1.1)\n .additionalProperty(\"id\", \"id\")\n .build()\n )\n );\n }\n}\n", + "async_client": "package com.example.usage;\n\nimport com.seed.unions.SeedUnionsClient;\nimport com.seed.unions.resources.union.types.Circle;\nimport com.seed.unions.resources.union.types.Shape;\n\npublic class Example {\n public static void main(String[] args) {\n SeedUnionsClient client = SeedUnionsClient\n .builder()\n .build();\n\n client.union().update(\n Shape.circle(\n Circle\n .builder()\n .radius(1.1)\n .additionalProperty(\"id\", \"id\")\n .build()\n )\n );\n }\n}\n" } } ], diff --git a/seed/java-sdk/unions/default/src/main/java/com/snippets/Example1.java b/seed/java-sdk/unions/default/src/main/java/com/snippets/Example1.java index 012001485ab4..94b247236465 100644 --- a/seed/java-sdk/unions/default/src/main/java/com/snippets/Example1.java +++ b/seed/java-sdk/unions/default/src/main/java/com/snippets/Example1.java @@ -10,7 +10,11 @@ public static void main(String[] args) { SeedUnionsClient.builder().url("https://api.fern.com").build(); client.bigunion() - .update(BigUnion.normalSweet( - NormalSweet.builder().value("value").build())); + .update(BigUnion.normalSweet(NormalSweet.builder() + .value("value") + .additionalProperty("id", "id") + .additionalProperty("created-at", "2024-01-15T09:30:00Z") + .additionalProperty("archived-at", "2024-01-15T09:30:00Z") + .build())); } } diff --git a/seed/java-sdk/unions/default/src/main/java/com/snippets/Example2.java b/seed/java-sdk/unions/default/src/main/java/com/snippets/Example2.java index 1528c974f238..8fe23290520d 100644 --- a/seed/java-sdk/unions/default/src/main/java/com/snippets/Example2.java +++ b/seed/java-sdk/unions/default/src/main/java/com/snippets/Example2.java @@ -12,9 +12,17 @@ public static void main(String[] args) { client.bigunion() .updateMany(Arrays.asList( - BigUnion.normalSweet( - NormalSweet.builder().value("value").build()), - BigUnion.normalSweet( - NormalSweet.builder().value("value").build()))); + BigUnion.normalSweet(NormalSweet.builder() + .value("value") + .additionalProperty("id", "id") + .additionalProperty("created-at", "2024-01-15T09:30:00Z") + .additionalProperty("archived-at", "2024-01-15T09:30:00Z") + .build()), + BigUnion.normalSweet(NormalSweet.builder() + .value("value") + .additionalProperty("id", "id") + .additionalProperty("created-at", "2024-01-15T09:30:00Z") + .additionalProperty("archived-at", "2024-01-15T09:30:00Z") + .build()))); } } diff --git a/seed/java-sdk/unions/default/src/main/java/com/snippets/Example4.java b/seed/java-sdk/unions/default/src/main/java/com/snippets/Example4.java index ad05a1d7dfed..1f129d7586ef 100644 --- a/seed/java-sdk/unions/default/src/main/java/com/snippets/Example4.java +++ b/seed/java-sdk/unions/default/src/main/java/com/snippets/Example4.java @@ -9,6 +9,10 @@ public static void main(String[] args) { SeedUnionsClient client = SeedUnionsClient.builder().url("https://api.fern.com").build(); - client.union().update(Shape.circle(Circle.builder().radius(1.1).build())); + client.union() + .update(Shape.circle(Circle.builder() + .radius(1.1) + .additionalProperty("id", "id") + .build())); } } diff --git a/seed/java-sdk/unions/default/src/test/java/com/seed/unions/BigunionWireTest.java b/seed/java-sdk/unions/default/src/test/java/com/seed/unions/BigunionWireTest.java index 0a77be20d6af..5f58e0beee48 100644 --- a/seed/java-sdk/unions/default/src/test/java/com/seed/unions/BigunionWireTest.java +++ b/seed/java-sdk/unions/default/src/test/java/com/seed/unions/BigunionWireTest.java @@ -90,8 +90,12 @@ else if (actualResponseNode.has("kind")) public void testUpdate() throws Exception { server.enqueue(new MockResponse().setResponseCode(200).setBody("true")); Boolean response = client.bigunion() - .update(BigUnion.normalSweet( - NormalSweet.builder().value("value").build())); + .update(BigUnion.normalSweet(NormalSweet.builder() + .value("value") + .additionalProperty("id", "id") + .additionalProperty("created-at", "2024-01-15T09:30:00Z") + .additionalProperty("archived-at", "2024-01-15T09:30:00Z") + .build())); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); Assertions.assertEquals("PATCH", request.getMethod()); @@ -165,10 +169,18 @@ public void testUpdateMany() throws Exception { server.enqueue(new MockResponse().setResponseCode(200).setBody("{\"string\":true}")); Map response = client.bigunion() .updateMany(Arrays.asList( - BigUnion.normalSweet( - NormalSweet.builder().value("value").build()), - BigUnion.normalSweet( - NormalSweet.builder().value("value").build()))); + BigUnion.normalSweet(NormalSweet.builder() + .value("value") + .additionalProperty("id", "id") + .additionalProperty("created-at", "2024-01-15T09:30:00Z") + .additionalProperty("archived-at", "2024-01-15T09:30:00Z") + .build()), + BigUnion.normalSweet(NormalSweet.builder() + .value("value") + .additionalProperty("id", "id") + .additionalProperty("created-at", "2024-01-15T09:30:00Z") + .additionalProperty("archived-at", "2024-01-15T09:30:00Z") + .build()))); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); Assertions.assertEquals("PATCH", request.getMethod()); diff --git a/seed/java-sdk/unions/default/src/test/java/com/seed/unions/UnionWireTest.java b/seed/java-sdk/unions/default/src/test/java/com/seed/unions/UnionWireTest.java index 50187a9f58bf..a6e0803f1bba 100644 --- a/seed/java-sdk/unions/default/src/test/java/com/seed/unions/UnionWireTest.java +++ b/seed/java-sdk/unions/default/src/test/java/com/seed/unions/UnionWireTest.java @@ -78,8 +78,11 @@ else if (actualResponseNode.has("kind")) @Test public void testUpdate() throws Exception { server.enqueue(new MockResponse().setResponseCode(200).setBody("true")); - Boolean response = - client.union().update(Shape.circle(Circle.builder().radius(1.1).build())); + Boolean response = client.union() + .update(Shape.circle(Circle.builder() + .radius(1.1) + .additionalProperty("id", "id") + .build())); RecordedRequest request = server.takeRequest(); Assertions.assertNotNull(request); Assertions.assertEquals("PATCH", request.getMethod());