diff --git a/generators/csharp/base/src/asIs/test/Utils/JsonElementComparer.Template.cs b/generators/csharp/base/src/asIs/test/Utils/JsonElementComparer.Template.cs index a37ef402c1ac..1dcb7ab11c99 100644 --- a/generators/csharp/base/src/asIs/test/Utils/JsonElementComparer.Template.cs +++ b/generators/csharp/base/src/asIs/test/Utils/JsonElementComparer.Template.cs @@ -92,8 +92,14 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/generators/csharp/base/src/context/GeneratorContext.ts b/generators/csharp/base/src/context/GeneratorContext.ts index 861d391bc3b7..ad8ddb1c4b9e 100644 --- a/generators/csharp/base/src/context/GeneratorContext.ts +++ b/generators/csharp/base/src/context/GeneratorContext.ts @@ -668,6 +668,10 @@ export abstract class GeneratorContext extends AbstractGeneratorContext { return undefined; } + public isLiteralValue(typeReference: TypeReference): boolean { + return this.getLiteralValue(typeReference) != null; + } + public getLiteralValue(typeReference: TypeReference): string | boolean | undefined { if (typeReference.type === "container" && typeReference.container.type === "literal") { const literal = typeReference.container.literal; diff --git a/generators/csharp/dynamic-snippets/src/EndpointSnippetGenerator.ts b/generators/csharp/dynamic-snippets/src/EndpointSnippetGenerator.ts index 5561bf9923fc..0053f7c22912 100644 --- a/generators/csharp/dynamic-snippets/src/EndpointSnippetGenerator.ts +++ b/generators/csharp/dynamic-snippets/src/EndpointSnippetGenerator.ts @@ -79,11 +79,13 @@ export class EndpointSnippetGenerator extends WithGeneration { snippet: FernIr.dynamic.EndpointSnippetRequest; options: Options; }): ast.AstNode { - // if we're actually passed the examples, we need to - // check that the endpoint that we're generating has an example that matches the snippet + // If we're passed endpoint examples and the snippet includes an id (i.e. it's an + // EndpointExample, not just an EndpointSnippetRequest), verify the id matches one of + // the examples. Snippets without an id are user-provided requests and skip this check. if ( endpoint.examples && - !endpoint.examples?.find((each) => is.DynamicIR.EndpointExample(snippet) && each.id === snippet.id) + is.DynamicIR.EndpointExample(snippet) && + !endpoint.examples.find((each) => each.id === snippet.id) ) { // the dsg expects us to just throw when there is nothing to generate. throw new Error("Endpoint does not have an example that matches the snippet"); diff --git a/generators/csharp/dynamic-snippets/src/__test__/DynamicSnippetsGenerator.test.ts b/generators/csharp/dynamic-snippets/src/__test__/DynamicSnippetsGenerator.test.ts index 822e8b5146ce..ad69998839aa 100644 --- a/generators/csharp/dynamic-snippets/src/__test__/DynamicSnippetsGenerator.test.ts +++ b/generators/csharp/dynamic-snippets/src/__test__/DynamicSnippetsGenerator.test.ts @@ -1,6 +1,9 @@ -import { DynamicSnippetsTestRunner } from "@fern-api/browser-compatible-base-generator"; +import { DynamicSnippetsTestRunner, Style } from "@fern-api/browser-compatible-base-generator"; +import { FernIr } from "@fern-api/dynamic-ir-sdk"; import { AbsoluteFilePath, join } from "@fern-api/path-utils"; +import { readFileSync } from "fs"; +import { DynamicSnippetsGenerator } from "../DynamicSnippetsGenerator.js"; import { buildDynamicSnippetsGenerator } from "./utils/buildDynamicSnippetsGenerator.js"; import { buildGeneratorConfig } from "./utils/buildGeneratorConfig.js"; @@ -16,6 +19,71 @@ const DYNAMIC_IR_TEST_DEFINITIONS_DIRECTORY = AbsoluteFilePath.of( `${__dirname}/../../../../../packages/cli/generation/ir-generator-tests/src/dynamic-snippets/__test__/test-definitions` ); +describe("snippets (endpoint with examples)", () => { + test("generates snippet for EndpointSnippetRequest when endpoint has examples", async () => { + const irFilepath = AbsoluteFilePath.of(join(DYNAMIC_IR_TEST_DEFINITIONS_DIRECTORY, "imdb.json")); + const ir: FernIr.dynamic.DynamicIntermediateRepresentation = JSON.parse(readFileSync(irFilepath, "utf-8")); + + // Inject examples onto the POST /movies/create-movie endpoint so the guard is exercised. + for (const endpoint of Object.values(ir.endpoints)) { + if (endpoint.location.path === "/movies/create-movie" && endpoint.location.method === "POST") { + endpoint.examples = [ + { + id: "example-1", + name: undefined, + endpoint: endpoint.location, + baseURL: undefined, + environment: undefined, + auth: { + type: "bearer", + token: "" + }, + pathParameters: undefined, + queryParameters: undefined, + headers: undefined, + requestBody: { + title: "Example Movie", + rating: 7.5 + } + } + ]; + } + } + + const generator = new DynamicSnippetsGenerator({ + ir, + config: buildGeneratorConfig(), + options: { style: Style.Concise } + }); + + // Call generate with a plain EndpointSnippetRequest (no id). + // Before the fix, this threw "Endpoint does not have an example that matches the snippet". + const response = await generator.generate({ + endpoint: { + method: "POST", + path: "/movies/create-movie" + }, + baseURL: undefined, + environment: undefined, + auth: { + type: "bearer", + token: "" + }, + pathParameters: undefined, + queryParameters: undefined, + headers: undefined, + requestBody: { + title: "The Matrix", + rating: 8.2 + } + }); + + expect(response.errors).toBeUndefined(); + expect(response.snippet).toBeTruthy(); + expect(response.snippet).toMatchSnapshot(); + }); +}); + describe("snippets (use-undiscriminated-unions)", () => { const generator = buildDynamicSnippetsGenerator({ irFilepath: AbsoluteFilePath.of(join(DYNAMIC_IR_TEST_DEFINITIONS_DIRECTORY, "exhaustive.json")), diff --git a/generators/csharp/dynamic-snippets/src/__test__/__snapshots__/DynamicSnippetsGenerator.test.ts.snap b/generators/csharp/dynamic-snippets/src/__test__/__snapshots__/DynamicSnippetsGenerator.test.ts.snap index a9329fa38985..11f2d100761e 100644 --- a/generators/csharp/dynamic-snippets/src/__test__/__snapshots__/DynamicSnippetsGenerator.test.ts.snap +++ b/generators/csharp/dynamic-snippets/src/__test__/__snapshots__/DynamicSnippetsGenerator.test.ts.snap @@ -276,32 +276,29 @@ await client.Endpoints.Container.GetAndReturnListOfPrimitivesAsync( `; exports[`snippets (default) > exhaustive > 'POST /container/map-prim-to-union (mi…' 1`] = ` -"[ - { - "severity": "CRITICAL", - "path": [ - "requestBody", - "test2" - ], - "message": "Expected number, got boolean" - }, - { - "severity": "CRITICAL", - "path": [ - "requestBody", - "test3" - ], - "message": "Expected number, got string" - }, - { - "severity": "CRITICAL", - "path": [ - "requestBody", - "test4" - ], - "message": "Expected number, got object" - } -]" +"using Acme; +using System.Collections.Generic; +using OneOf; + +var client = new AcmeClient( + token: "" +); + +await client.Endpoints.Container.GetAndReturnMapOfPrimToUndiscriminatedUnionAsync( + new Dictionary>>(){ + ["test"] = 0, + ["test2"] = true, + ["test3"] = "Test", + ["test4"] = new List(){ + "1", + "1", + "1", + "1", + } + , + } +); +" `; exports[`snippets (default) > file-upload > 'POST /' 1`] = ` @@ -706,6 +703,23 @@ exports[`snippets (default) > single-url-environment-default > 'invalid environm ]" `; +exports[`snippets (endpoint with examples) > generates snippet for EndpointSnippetRequest when endpoint has examples 1`] = ` +"using Acme; +using Acme.Imdb; + +var client = new AcmeClient( + token: "" +); + +await client.Imdb.CreateMovieAsync( + new CreateMovieRequest { + Title = "The Matrix", + Rating = 8.2 + } +); +" +`; + exports[`snippets (use-undiscriminated-unions) > POST /container/map-prim-to-union (mixed values) 1`] = ` "using Acme; using System.Collections.Generic; @@ -718,6 +732,15 @@ var client = new AcmeClient( await client.Endpoints.Container.GetAndReturnMapOfPrimToUndiscriminatedUnionAsync( new Dictionary(){ ["test"] = 0, + ["test2"] = true, + ["test3"] = "Test", + ["test4"] = new List(){ + "1", + "1", + "1", + "1", + } + , } ); " diff --git a/generators/csharp/dynamic-snippets/src/context/DynamicLiteralMapper.ts b/generators/csharp/dynamic-snippets/src/context/DynamicLiteralMapper.ts index bf4c116b2cae..4d943073ac9c 100644 --- a/generators/csharp/dynamic-snippets/src/context/DynamicLiteralMapper.ts +++ b/generators/csharp/dynamic-snippets/src/context/DynamicLiteralMapper.ts @@ -657,10 +657,16 @@ export class DynamicLiteralMapper extends WithGeneration { value: unknown; }): { valueTypeReference: FernIr.dynamic.TypeReference; typeLiteral: ast.Literal } | undefined { for (const typeReference of undiscriminatedUnion.types) { + const errorsBefore = this.context.errors.size(); try { const typeLiteral = this.convert({ typeReference, value }); + if (is.Literal.nop(typeLiteral) || this.context.errors.size() > errorsBefore) { + this.context.errors.truncate(errorsBefore); + continue; + } return { valueTypeReference: typeReference, typeLiteral }; } catch (e) { + this.context.errors.truncate(errorsBefore); continue; } } diff --git a/generators/csharp/model/src/object/ObjectGenerator.ts b/generators/csharp/model/src/object/ObjectGenerator.ts index b9e0bc4471f1..567844330936 100644 --- a/generators/csharp/model/src/object/ObjectGenerator.ts +++ b/generators/csharp/model/src/object/ObjectGenerator.ts @@ -173,19 +173,37 @@ export class ObjectGenerator extends FileGenerator { - const propertyName = this.getPropertyName({ - className: this.classReference.name, - objectProperty: exampleProperty.name - }); - const assignment = this.exampleGenerator.getSnippetForTypeReference({ - exampleTypeReference: exampleProperty.value, - parseDatetimes + // When generateLiterals is enabled, collect wire values of literal properties so we + // can skip them in the object initializer. Their default `= new()` already sets the + // correct value and assigning a plain string would cause a CS0029 compilation error. + const literalPropertyWireValues = new Set(); + if (this.generation.settings.generateLiterals) { + const allProps = [ + ...this.objectDeclaration.properties, + ...(this.objectDeclaration.extendedProperties ?? []) + ]; + for (const prop of allProps) { + if (this.context.isLiteralValue(prop.valueType)) { + literalPropertyWireValues.add(getWireValue(prop.name)); + } + } + } + + const args = exampleObject.properties + .filter((exampleProperty) => !literalPropertyWireValues.has(getWireValue(exampleProperty.name))) + .map((exampleProperty) => { + const propertyName = this.getPropertyName({ + className: this.classReference.name, + objectProperty: exampleProperty.name + }); + const assignment = this.exampleGenerator.getSnippetForTypeReference({ + exampleTypeReference: exampleProperty.value, + parseDatetimes + }); + // todo: considering filtering out "assignments" are are actually just null so that null properties + // are completely excluded from object initializers + return { name: propertyName, assignment }; }); - // todo: considering filtering out "assignments" are are actually just null so that null properties - // are completely excluded from object initializers - return { name: propertyName, assignment }; - }); // Include default values for required properties missing from the example // so the generated object initializer compiles without CS9035 errors. @@ -198,6 +216,10 @@ export class ObjectGenerator extends FileGenerator(); + if (this.generation.settings.generateLiterals && this.endpoint.requestBody?.type === "inlinedRequestBody") { + for (const prop of [ + ...this.endpoint.requestBody.properties, + ...(this.endpoint.requestBody.extendedProperties ?? []) + ]) { + if (this.context.isLiteralValue(prop.valueType)) { + literalBodyPropertyWireValues.add(getWireValue(prop.name)); + } + } + } + example.request?._visit({ reference: (reference) => { orderedFields.push({ @@ -357,6 +373,9 @@ export class WrappedRequestGenerator extends FileGenerator { for (const property of inlinedRequestBody.properties) { + if (literalBodyPropertyWireValues.has(getWireValue(property.name))) { + continue; + } orderedFields.push({ name: property.name, value: this.exampleGenerator.getSnippetForTypeReference({ diff --git a/generators/csharp/sdk/versions.yml b/generators/csharp/sdk/versions.yml index e96731442290..876485a5dd9c 100644 --- a/generators/csharp/sdk/versions.yml +++ b/generators/csharp/sdk/versions.yml @@ -1,4 +1,55 @@ # yaml-language-server: $schema=../../../fern-versions-yml.schema.json +- version: 2.59.4 + changelogEntry: + - summary: | + Add `GetSingle()` fallback to `JsonElementComparer` number comparison. + When two JSON numbers differ as decimals but match as singles, they + represent the same float32 value and are now considered equal. This + fixes mock server test failures for fields declared as `format: float` + where C#'s `System.Text.Json` serializes `System.Single` with a shorter + decimal representation than the original JSON string (e.g. + 0.10722749680280685 vs 0.1072275). + type: fix + createdAt: "2026-04-10" + irVersion: 66 + +- version: 2.59.3 + changelogEntry: + - summary: | + Fix mock server test and snippet generation to skip literal properties + in object initializers when `generate-literals` is enabled. Previously, + the generator emitted plain string/boolean assignments for `TypeLiteral` + properties, causing CS0029 compilation errors. Literal properties now + rely on their `= new()` default initializer. + type: fix + createdAt: "2026-04-09" + irVersion: 66 + +- version: 2.59.2 + changelogEntry: + - summary: | + Fix dynamic snippet generation failing with "Endpoint does not have an + example that matches the snippet" when the endpoint has examples but the + request is a plain `EndpointSnippetRequest` without an `id`. The guard now + only validates the example match when the snippet includes an `id`. + type: fix + createdAt: "2026-04-09" + irVersion: 66 + +- version: 2.59.1 + changelogEntry: + - summary: | + Fix undiscriminated union variant matching in dynamic snippets selecting + incorrect variants when errors are added during conversion. The matcher + now checks whether errors were added (via `errors.size() > errorsBefore`) + alongside the existing `isNop` check, and adds a missing `nop` check that + was causing the first variant to be unconditionally returned. This prevents + empty objects from being returned for union fields like `options` in + generated code snippets. + type: fix + createdAt: "2026-04-09" + irVersion: 66 + - version: 2.59.0 changelogEntry: - summary: | diff --git a/generators/go-v2/dynamic-snippets/src/__test__/__snapshots__/DynamicSnippetsGenerator.test.ts.snap b/generators/go-v2/dynamic-snippets/src/__test__/__snapshots__/DynamicSnippetsGenerator.test.ts.snap index bd73ec62b277..a394d17cf77c 100644 --- a/generators/go-v2/dynamic-snippets/src/__test__/__snapshots__/DynamicSnippetsGenerator.test.ts.snap +++ b/generators/go-v2/dynamic-snippets/src/__test__/__snapshots__/DynamicSnippetsGenerator.test.ts.snap @@ -378,56 +378,47 @@ func do() { `; exports[`snippets (default) > exhaustive > 'POST /container/map-prim-to-union (mi…' 1`] = ` -"[ - { - "severity": "CRITICAL", - "path": [ - "requestBody", - "test2" - ], - "message": "Expected number, got boolean" - }, - { - "severity": "CRITICAL", - "path": [ - "requestBody", - "test3" - ], - "message": "Expected number, got string" - }, - { - "severity": "CRITICAL", - "path": [ - "requestBody", - "test3" - ], - "message": "Expected boolean, got string" - }, - { - "severity": "CRITICAL", - "path": [ - "requestBody", - "test4" - ], - "message": "Expected number, got object" - }, - { - "severity": "CRITICAL", - "path": [ - "requestBody", - "test4" - ], - "message": "Expected boolean, got object" - }, - { - "severity": "CRITICAL", - "path": [ - "requestBody", - "test4" - ], - "message": "Expected string, got object" - } -]" +"package example + +import ( + context "context" + + client "github.com/acme/acme-go/client" + option "github.com/acme/acme-go/option" + types "github.com/acme/acme-go/types" +) + +func do() { + client := client.NewClient( + option.WithToken( + "", + ), + ) + request := map[string]*types.MixedType{ + "test": &types.MixedType{ + Double: 0, + }, + "test2": &types.MixedType{ + Boolean: true, + }, + "test3": &types.MixedType{ + String: "Test", + }, + "test4": &types.MixedType{ + StringList: []string{ + "1", + "1", + "1", + "1", + }, + }, + } + client.Endpoints.Container.GetAndReturnMapOfPrimToUndiscriminatedUnion( + context.TODO(), + request, + ) +} +" `; exports[`snippets (default) > file-upload > 'POST /' 1`] = ` @@ -1359,56 +1350,47 @@ func do() { `; exports[`snippets (exportAllRequestsAtRoot) > exhaustive > 'POST /container/map-prim-to-union (mi…' 1`] = ` -"[ - { - "severity": "CRITICAL", - "path": [ - "requestBody", - "test2" - ], - "message": "Expected number, got boolean" - }, - { - "severity": "CRITICAL", - "path": [ - "requestBody", - "test3" - ], - "message": "Expected number, got string" - }, - { - "severity": "CRITICAL", - "path": [ - "requestBody", - "test3" - ], - "message": "Expected boolean, got string" - }, - { - "severity": "CRITICAL", - "path": [ - "requestBody", - "test4" - ], - "message": "Expected number, got object" - }, - { - "severity": "CRITICAL", - "path": [ - "requestBody", - "test4" - ], - "message": "Expected boolean, got object" - }, - { - "severity": "CRITICAL", - "path": [ - "requestBody", - "test4" - ], - "message": "Expected string, got object" - } -]" +"package example + +import ( + context "context" + + client "github.com/acme/acme-go/client" + option "github.com/acme/acme-go/option" + types "github.com/acme/acme-go/types" +) + +func do() { + client := client.NewClient( + option.WithToken( + "", + ), + ) + request := map[string]*types.MixedType{ + "test": &types.MixedType{ + Double: 0, + }, + "test2": &types.MixedType{ + Boolean: true, + }, + "test3": &types.MixedType{ + String: "Test", + }, + "test4": &types.MixedType{ + StringList: []string{ + "1", + "1", + "1", + "1", + }, + }, + } + client.Endpoints.Container.GetAndReturnMapOfPrimToUndiscriminatedUnion( + context.TODO(), + request, + ) +} +" `; exports[`snippets (exportAllRequestsAtRoot) > file-upload > 'POST /' 1`] = ` @@ -2340,56 +2322,47 @@ func do() { `; exports[`snippets (exportedClientName) > exhaustive > 'POST /container/map-prim-to-union (mi…' 1`] = ` -"[ - { - "severity": "CRITICAL", - "path": [ - "requestBody", - "test2" - ], - "message": "Expected number, got boolean" - }, - { - "severity": "CRITICAL", - "path": [ - "requestBody", - "test3" - ], - "message": "Expected number, got string" - }, - { - "severity": "CRITICAL", - "path": [ - "requestBody", - "test3" - ], - "message": "Expected boolean, got string" - }, - { - "severity": "CRITICAL", - "path": [ - "requestBody", - "test4" - ], - "message": "Expected number, got object" - }, - { - "severity": "CRITICAL", - "path": [ - "requestBody", - "test4" - ], - "message": "Expected boolean, got object" - }, - { - "severity": "CRITICAL", - "path": [ - "requestBody", - "test4" - ], - "message": "Expected string, got object" - } -]" +"package example + +import ( + context "context" + + client "github.com/acme/acme-go/client" + option "github.com/acme/acme-go/option" + types "github.com/acme/acme-go/types" +) + +func do() { + client := client.NewFernClient( + option.WithToken( + "", + ), + ) + request := map[string]*types.MixedType{ + "test": &types.MixedType{ + Double: 0, + }, + "test2": &types.MixedType{ + Boolean: true, + }, + "test3": &types.MixedType{ + String: "Test", + }, + "test4": &types.MixedType{ + StringList: []string{ + "1", + "1", + "1", + "1", + }, + }, + } + client.Endpoints.Container.GetAndReturnMapOfPrimToUndiscriminatedUnion( + context.TODO(), + request, + ) +} +" `; exports[`snippets (exportedClientName) > file-upload > 'POST /' 1`] = ` diff --git a/generators/go-v2/dynamic-snippets/src/context/DynamicTypeInstantiationMapper.ts b/generators/go-v2/dynamic-snippets/src/context/DynamicTypeInstantiationMapper.ts index 6ad0941d0f8a..4d32c59e7f79 100644 --- a/generators/go-v2/dynamic-snippets/src/context/DynamicTypeInstantiationMapper.ts +++ b/generators/go-v2/dynamic-snippets/src/context/DynamicTypeInstantiationMapper.ts @@ -578,14 +578,16 @@ export class DynamicTypeInstantiationMapper { value: unknown; }): { valueTypeReference: FernIr.dynamic.TypeReference; typeInstantiation: go.TypeInstantiation } | undefined { for (const typeReference of undiscriminatedUnion.types) { + const errorsBefore = this.context.errors.size(); try { const typeInstantiation = this.convert({ typeReference, value }); - // Skip types that result in nop() - this means the value didn't match the type - if (go.TypeInstantiation.isNop(typeInstantiation)) { + if (go.TypeInstantiation.isNop(typeInstantiation) || this.context.errors.size() > errorsBefore) { + this.context.errors.truncate(errorsBefore); continue; } return { valueTypeReference: typeReference, typeInstantiation }; } catch (e) { + this.context.errors.truncate(errorsBefore); continue; } } diff --git a/generators/go/sdk/versions.yml b/generators/go/sdk/versions.yml index 5132e19d9598..5870da948cad 100644 --- a/generators/go/sdk/versions.yml +++ b/generators/go/sdk/versions.yml @@ -1,4 +1,16 @@ # yaml-language-server: $schema=../../../fern-versions-yml.schema.json +- version: 1.34.3 + changelogEntry: + - summary: | + Fix undiscriminated union variant matching in dynamic snippets selecting + incorrect variants when errors are added during conversion. The matcher + now checks whether errors were added (via `errors.size() > errorsBefore`) + alongside the existing `isNop` check, preventing empty objects from being + returned for union fields like `options` in generated code snippets. + type: fix + createdAt: "2026-04-09" + irVersion: 66 + - version: 1.34.2 changelogEntry: - summary: | diff --git a/generators/java-v2/base/package.json b/generators/java-v2/base/package.json index 659941158e9e..90770f52864a 100644 --- a/generators/java-v2/base/package.json +++ b/generators/java-v2/base/package.json @@ -41,7 +41,7 @@ "@fern-api/fs-utils": "workspace:*", "@fern-api/java-ast": "workspace:*", "@fern-api/logging-execa": "workspace:*", - "@fern-fern/ir-sdk": "^65.4.0", + "@fern-fern/ir-sdk": "^66.0.0", "@types/node": "catalog:", "typescript": "catalog:", "vitest": "catalog:" diff --git a/generators/java-v2/base/src/context/AbstractJavaGeneratorContext.ts b/generators/java-v2/base/src/context/AbstractJavaGeneratorContext.ts index 3f8b730c0474..f9981f806f29 100644 --- a/generators/java-v2/base/src/context/AbstractJavaGeneratorContext.ts +++ b/generators/java-v2/base/src/context/AbstractJavaGeneratorContext.ts @@ -1,4 +1,9 @@ -import { AbstractGeneratorContext, FernGeneratorExec, GeneratorNotificationService } from "@fern-api/base-generator"; +import { + AbstractGeneratorContext, + CaseConverter, + FernGeneratorExec, + GeneratorNotificationService +} from "@fern-api/base-generator"; import { BaseJavaCustomConfigSchema, java } from "@fern-api/java-ast"; import { FernIr } from "@fern-fern/ir-sdk"; import { JavaProject } from "../project/JavaProject.js"; @@ -10,6 +15,7 @@ export abstract class AbstractJavaGeneratorContext< > extends AbstractGeneratorContext { public readonly javaTypeMapper: JavaTypeMapper; public readonly project: JavaProject; + public readonly caseConverter: CaseConverter; public constructor( public readonly ir: FernIr.IntermediateRepresentation, @@ -18,6 +24,11 @@ export abstract class AbstractJavaGeneratorContext< public readonly generatorNotificationService: GeneratorNotificationService ) { super(config, generatorNotificationService); + this.caseConverter = new CaseConverter({ + generationLanguage: "java", + keywords: ir.casingsConfig?.keywords, + smartCasing: ir.casingsConfig?.smartCasing ?? true + }); this.javaTypeMapper = new JavaTypeMapper(this); this.project = new JavaProject({ context: this }); } @@ -37,7 +48,7 @@ export abstract class AbstractJavaGeneratorContext< typeDeclaration: FernIr.TypeDeclaration; }): java.ClassReference { return java.classReference({ - name: typeDeclaration.name.name.pascalCase.unsafeName, + name: this.caseConverter.pascalUnsafe(typeDeclaration.name.name), packageName: this.getTypesPackageName(typeDeclaration.name.fernFilepath) }); } @@ -55,6 +66,6 @@ export abstract class AbstractJavaGeneratorContext< } public getClassName(name: FernIr.Name): string { - return name.pascalCase.safeName; + return this.caseConverter.pascalSafe(name); } } diff --git a/generators/java-v2/dynamic-snippets/src/context/DynamicTypeLiteralMapper.ts b/generators/java-v2/dynamic-snippets/src/context/DynamicTypeLiteralMapper.ts index 019320133c13..1d38ca231afa 100644 --- a/generators/java-v2/dynamic-snippets/src/context/DynamicTypeLiteralMapper.ts +++ b/generators/java-v2/dynamic-snippets/src/context/DynamicTypeLiteralMapper.ts @@ -1,5 +1,5 @@ import { Severity } from "@fern-api/browser-compatible-base-generator"; -import { assertNever, extractErrorMessage } from "@fern-api/core-utils"; +import { assertNever } from "@fern-api/core-utils"; import { FernIr } from "@fern-api/dynamic-ir-sdk"; import { java } from "@fern-api/java-ast"; @@ -691,20 +691,16 @@ export class DynamicTypeLiteralMapper { undiscriminatedUnion: FernIr.dynamic.UndiscriminatedUnionType; value: unknown; }): { valueTypeReference: FernIr.dynamic.TypeReference; typeInstantiation: java.TypeLiteral } | undefined { - const attemptedVariants: string[] = []; - const variantErrors: string[] = []; - for (const typeReference of undiscriminatedUnion.types) { const errorsBefore = this.context.errors.size(); try { - attemptedVariants.push(JSON.stringify(typeReference)); const typeInstantiation = this.convert({ typeReference, value, inUndiscriminatedUnion: true }); - if (java.TypeLiteral.isNop(typeInstantiation)) { + if (java.TypeLiteral.isNop(typeInstantiation) || this.context.errors.size() > errorsBefore) { this.context.errors.truncate(errorsBefore); continue; } @@ -712,26 +708,15 @@ export class DynamicTypeLiteralMapper { return { valueTypeReference: typeReference, typeInstantiation }; } catch (e) { this.context.errors.truncate(errorsBefore); - variantErrors.push(`Type ${JSON.stringify(typeReference)}: ${extractErrorMessage(e)}`); continue; } } this.context.errors.add({ severity: Severity.Critical, - message: `None of the types in the undiscriminated union matched the given "${typeof value}" value. Tried ${attemptedVariants.length} variants. Errors: ${variantErrors.join("; ")}` + message: `None of the types in the undiscriminated union matched the given "${typeof value}" value` }); - - // Instead of returning undefined (which causes invalid code generation), - // throw an error to fail fast with a clear message - const unionName = undiscriminatedUnion.declaration.name ?? "UnknownUnion"; - const detailedErrors = variantErrors.map((error, index) => ` ${index + 1}. ${error}`).join("\n"); - throw new Error( - `Failed to match undiscriminated union "${unionName}" for ${typeof value} value.\n` + - `Value: ${JSON.stringify(value)}\n` + - `Attempted ${attemptedVariants.length} variants:\n${detailedErrors}\n\n` + - `This prevents invalid snippet code generation that would cause formatter errors.` - ); + return undefined; } private getUndiscriminatedUnionFieldName({ diff --git a/generators/java-v2/sdk/package.json b/generators/java-v2/sdk/package.json index 32a8e63b2662..672dc9d8a129 100644 --- a/generators/java-v2/sdk/package.json +++ b/generators/java-v2/sdk/package.json @@ -49,7 +49,7 @@ "@fern-api/logger": "workspace:*", "@fern-fern/generator-cli-sdk": "^0.1.8", "@fern-fern/generator-exec-sdk": "catalog:", - "@fern-fern/ir-sdk": "^65.4.0", + "@fern-fern/ir-sdk": "^66.0.0", "@types/lodash-es": "catalog:", "@types/node": "catalog:", "lodash-es": "catalog:", diff --git a/generators/java-v2/sdk/src/SdkGeneratorContext.ts b/generators/java-v2/sdk/src/SdkGeneratorContext.ts index d68ca71aa35d..168113e4e0d8 100644 --- a/generators/java-v2/sdk/src/SdkGeneratorContext.ts +++ b/generators/java-v2/sdk/src/SdkGeneratorContext.ts @@ -1,10 +1,11 @@ -import { GeneratorNotificationService } from "@fern-api/base-generator"; +import { GeneratorNotificationService, getOriginalName, NameInput } from "@fern-api/base-generator"; import { assertNever } from "@fern-api/core-utils"; import { java } from "@fern-api/java-ast"; import { AbstractJavaGeneratorContext } from "@fern-api/java-base"; import { FernGeneratorExec } from "@fern-fern/generator-exec-sdk"; import { FernIr } from "@fern-fern/ir-sdk"; import { camelCase } from "lodash-es"; + import { TYPES_DIRECTORY } from "./constants.js"; import { JavaGeneratorAgent } from "./JavaGeneratorAgent.js"; import { ReadmeConfigBuilder } from "./readme/ReadmeConfigBuilder.js"; @@ -112,7 +113,7 @@ export class SdkGeneratorContext extends AbstractJavaGeneratorContext service.name?.fernFilepath?.allParts?.map((part) => part.originalName).join("") || "" + (service) => service.name?.fernFilepath?.allParts?.map((part) => getOriginalName(part)).join("") || "" ); if ( @@ -352,8 +353,8 @@ export class SdkGeneratorContext extends AbstractJavaGeneratorContext this.getKeyWordCompatibleMethodName(part.camelCase.safeName) + "()" + (part) => this.getKeyWordCompatibleMethodName(this.context.caseConverter.camelSafe(part)) + "()" ); return clientAccessParts.length > 0 ? java.codeblock(`${ReadmeSnippetBuilder.CLIENT_VARIABLE_NAME}.${clientAccessParts.join(".")}`) @@ -810,7 +810,7 @@ ${clientClassName} client = ${clientClassName}.builder() } private getEndpointMethodName(endpoint: FernIr.HttpEndpoint): string { - return endpoint.name.camelCase.unsafeName; + return this.context.caseConverter.camelUnsafe(endpoint.name); } private getDefaultEnvironmentId(): string | undefined { @@ -900,7 +900,8 @@ ${clientClassName} client = ${clientClassName}.builder() if (this.context.ir.auth.schemes.length > 0) { const authScheme = this.context.ir.auth.schemes[0]; if (authScheme?.type === "bearer") { - const tokenName = authScheme.token?.camelCase?.unsafeName ?? "token"; + const tokenName = + authScheme.token != null ? this.context.caseConverter.camelUnsafe(authScheme.token) : "token"; builderParameters.push({ name: tokenName, value: java.TypeLiteral.string("") @@ -915,7 +916,8 @@ ${clientClassName} client = ${clientClassName}.builder() value: java.TypeLiteral.string("") }); } else if (authScheme?.type === "header") { - const headerName = authScheme.name.name?.camelCase?.unsafeName ?? "apiKey"; + const headerName = + authScheme.name != null ? this.context.caseConverter.camelUnsafe(authScheme.name) : "apiKey"; builderParameters.push({ name: headerName, value: java.TypeLiteral.string("") @@ -926,8 +928,10 @@ ${clientClassName} client = ${clientClassName}.builder() if (this.context.ir.variables != null && this.context.ir.variables.length > 0) { for (const variable of this.context.ir.variables) { builderParameters.push({ - name: variable.name.camelCase.unsafeName, - value: java.TypeLiteral.string(`YOUR_${variable.name.screamingSnakeCase.unsafeName}`) + name: this.context.caseConverter.camelUnsafe(variable.name), + value: java.TypeLiteral.string( + `YOUR_${this.context.caseConverter.screamingSnakeUnsafe(variable.name)}` + ) }); } } @@ -935,16 +939,20 @@ ${clientClassName} client = ${clientClassName}.builder() if (this.context.ir.pathParameters != null && this.context.ir.pathParameters.length > 0) { for (const param of this.context.ir.pathParameters.filter((p) => p.variable == null)) { builderParameters.push({ - name: param.name.camelCase.unsafeName, - value: java.TypeLiteral.string(`YOUR_${param.name.screamingSnakeCase.unsafeName}`) + name: this.context.caseConverter.camelUnsafe(param.name), + value: java.TypeLiteral.string( + `YOUR_${this.context.caseConverter.screamingSnakeUnsafe(param.name)}` + ) }); } } // Environment URL variables (e.g., tenantDomain) for (const urlVariable of this.getEnvironmentUrlVariables()) { builderParameters.push({ - name: urlVariable.name.camelCase.unsafeName, - value: java.TypeLiteral.string(`YOUR_${urlVariable.name.screamingSnakeCase.unsafeName}`) + name: this.context.caseConverter.camelUnsafe(urlVariable.name), + value: java.TypeLiteral.string( + `YOUR_${this.context.caseConverter.screamingSnakeUnsafe(urlVariable.name)}` + ) }); } } @@ -1029,8 +1037,7 @@ ${clientClassName} client = ${clientClassName}.builder() // Get access path to WebSocket client from root client const clientAccessParts = fernFilepath.allParts.map( - (part: { camelCase: { safeName: string } }) => - this.getKeyWordCompatibleMethodName(part.camelCase.safeName) + "()" + (part) => this.getKeyWordCompatibleMethodName(this.context.caseConverter.camelSafe(part)) + "()" ); const wsClientAccess = clientAccessParts.length > 0 @@ -1100,11 +1107,11 @@ ${clientClassName} client = ${clientClassName}.builder() } // Build the factory method name: WebSocket() - const channelName = channel.name.camelCase.safeName; + const channelName = this.context.caseConverter.camelSafe(channel.name); const wsFactoryMethod = `${channelName}WebSocket`; // Build connect options class name: ConnectOptions - const channelPascalName = channel.name.pascalCase.safeName; + const channelPascalName = this.context.caseConverter.pascalSafe(channel.name); const connectOptionsClass = `${channelPascalName}ConnectOptions`; // Check if there are required query parameters for the connect options diff --git a/generators/java-v2/sdk/src/reference/EndpointSnippetsGenerator.ts b/generators/java-v2/sdk/src/reference/EndpointSnippetsGenerator.ts index a38d8d8f5660..c578473d7f49 100644 --- a/generators/java-v2/sdk/src/reference/EndpointSnippetsGenerator.ts +++ b/generators/java-v2/sdk/src/reference/EndpointSnippetsGenerator.ts @@ -1,3 +1,4 @@ +import { getOriginalName } from "@fern-api/base-generator"; import { DynamicSnippetsGenerator } from "@fern-api/java-dynamic-snippets"; import { FernIr } from "@fern-fern/ir-sdk"; @@ -126,7 +127,7 @@ export class EndpointSnippetsGenerator { } // Fallback: try to find by example name - const exampleName = example.name?.originalName; + const exampleName = example.name != null ? getOriginalName(example.name) : undefined; const nameMatchedSnippet = snippets.userSpecified.find((s) => s.exampleIdentifier === exampleName) ?? snippets.autogenerated.find((s) => s.exampleIdentifier === exampleName); diff --git a/generators/java-v2/sdk/src/reference/buildReference.ts b/generators/java-v2/sdk/src/reference/buildReference.ts index c4f7aa96a680..0d22d1bef43d 100644 --- a/generators/java-v2/sdk/src/reference/buildReference.ts +++ b/generators/java-v2/sdk/src/reference/buildReference.ts @@ -13,7 +13,7 @@ export function buildReference({ context }: { context: SdkGeneratorContext }): R serviceEntries.forEach(([serviceId, service]) => { const section = isRootServiceId({ context, serviceId }) ? builder.addRootSection() - : builder.addSection({ title: getSectionTitle({ service }) }); + : builder.addSection({ title: getSectionTitle({ context, service }) }); const endpoints = getEndpointReferencesForService({ context, serviceId, service }); for (const endpoint of endpoints) { section.addEndpoint(endpoint); @@ -83,7 +83,7 @@ function getEndpointReference({ text: getAccessFromRootClient({ context, service }) + "." }, { - text: getEndpointMethodName({ endpoint }) + text: getEndpointMethodName({ context, endpoint }) }, { text: getReferenceEndpointInvocationParameters({ context, endpoint }) @@ -105,12 +105,18 @@ function getAccessFromRootClient({ service: FernIr.HttpService; }): string { const clientVariableName = "client"; - const servicePath = service.name.fernFilepath.allParts.map((part) => part.camelCase.safeName); + const servicePath = service.name.fernFilepath.allParts.map((part) => context.caseConverter.camelSafe(part)); return servicePath.length > 0 ? `${clientVariableName}.${servicePath.join(".")}` : clientVariableName; } -function getEndpointMethodName({ endpoint }: { endpoint: FernIr.HttpEndpoint }): string { - return endpoint.name.camelCase.safeName; +function getEndpointMethodName({ + context, + endpoint +}: { + context: SdkGeneratorContext; + endpoint: FernIr.HttpEndpoint; +}): string { + return context.caseConverter.camelSafe(endpoint.name); } function getReferenceEndpointInvocationParameters({ @@ -123,7 +129,7 @@ function getReferenceEndpointInvocationParameters({ const parameters: string[] = []; endpoint.allPathParameters.forEach((pathParam) => { - parameters.push(pathParam.name.camelCase.safeName); + parameters.push(context.caseConverter.camelSafe(pathParam.name)); }); if (endpoint.requestBody != null) { @@ -196,7 +202,7 @@ function getEndpointParameters({ endpoint.allPathParameters.forEach((pathParam) => { parameters.push({ - name: pathParam.name.camelCase.safeName, + name: context.caseConverter.camelSafe(pathParam.name), type: getJavaTypeString({ context, typeReference: pathParam.valueType }), description: pathParam.docs, required: true @@ -205,7 +211,7 @@ function getEndpointParameters({ endpoint.queryParameters.forEach((queryParam) => { parameters.push({ - name: queryParam.name.name.camelCase.safeName, + name: context.caseConverter.camelSafe(queryParam.name), type: getJavaTypeString({ context, typeReference: queryParam.valueType }), description: queryParam.docs, required: !queryParam.allowMultiple @@ -214,7 +220,7 @@ function getEndpointParameters({ endpoint.headers.forEach((header) => { parameters.push({ - name: header.name.name.camelCase.safeName, + name: context.caseConverter.camelSafe(header.name), type: getJavaTypeString({ context, typeReference: header.valueType }), description: header.docs, required: true @@ -224,7 +230,7 @@ function getEndpointParameters({ if (endpoint.requestBody != null && endpoint.requestBody.type === "inlinedRequestBody") { endpoint.requestBody.properties.forEach((property) => { parameters.push({ - name: property.name.name.camelCase.safeName, + name: context.caseConverter.camelSafe(property.name), type: getJavaTypeString({ context, typeReference: property.valueType }), description: property.docs, required: true @@ -289,6 +295,9 @@ function isRootServiceId({ return context.ir.rootPackage.service === serviceId; } -function getSectionTitle({ service }: { service: FernIr.HttpService }): string { - return service.displayName ?? service.name.fernFilepath.allParts.map((part) => part.pascalCase.safeName).join(" "); +function getSectionTitle({ context, service }: { context: SdkGeneratorContext; service: FernIr.HttpService }): string { + return ( + service.displayName ?? + service.name.fernFilepath.allParts.map((part) => context.caseConverter.pascalSafe(part)).join(" ") + ); } diff --git a/generators/java-v2/sdk/src/sdk-wire-tests/SdkWireTestGenerator.ts b/generators/java-v2/sdk/src/sdk-wire-tests/SdkWireTestGenerator.ts index 7851b55dc069..1d479bc72327 100644 --- a/generators/java-v2/sdk/src/sdk-wire-tests/SdkWireTestGenerator.ts +++ b/generators/java-v2/sdk/src/sdk-wire-tests/SdkWireTestGenerator.ts @@ -1,4 +1,4 @@ -import { File } from "@fern-api/base-generator"; +import { File, getOriginalName } from "@fern-api/base-generator"; import { extractErrorMessage } from "@fern-api/core-utils"; import { RelativeFilePath } from "@fern-api/fs-utils"; import { java } from "@fern-api/java-ast"; @@ -12,6 +12,7 @@ import { TestMethodBuilder } from "./builders/TestMethodBuilder.js"; import { SnippetExtractor } from "./extractors/SnippetExtractor.js"; import { WireTestDataExtractor, WireTestExample } from "./extractors/TestDataExtractor.js"; import { TestResourceWriter } from "./resources/TestResourceWriter.js"; + /** * Generates wire tests that validate SDK adherence to API specifications. */ @@ -182,14 +183,16 @@ export class SdkWireTestGenerator { if (firstDynamicExample) { try { this.context.logger.debug( - `Generating snippet for endpoint ${endpoint.id} (${endpoint.name.originalName}) with FernIr.dynamic endpoint ${dynamicEndpoint.declaration.name.originalName}` + `Generating snippet for endpoint ${endpoint.id} (${getOriginalName(endpoint.name)}) with FernIr.dynamic endpoint ${getOriginalName(dynamicEndpoint.declaration.name)}` ); const expectedServiceName = serviceName.toLowerCase(); // Use the same fallback strategy as IR service resolution const dynamicServiceName = ( - dynamicEndpoint.declaration.fernFilepath?.allParts?.[0]?.originalName || - dynamicEndpoint.declaration.name.originalName || + (dynamicEndpoint.declaration.fernFilepath?.allParts?.[0] != null + ? getOriginalName(dynamicEndpoint.declaration.fernFilepath.allParts[0]) + : undefined) || + getOriginalName(dynamicEndpoint.declaration.name) || "Service" ).toLowerCase(); @@ -215,11 +218,11 @@ export class SdkWireTestGenerator { const testMethodCall = snippetExtractor.extractMethodCall(fullSnippet); if (testMethodCall === null) { this.context.logger.debug( - `Skipping endpoint ${endpoint.id} (${endpoint.name.originalName}): Could not extract method call from snippet` + `Skipping endpoint ${endpoint.id} (${getOriginalName(endpoint.name)}): Could not extract method call from snippet` ); skippedEndpoints.push({ endpointId: endpoint.id, - endpointName: endpoint.name.originalName, + endpointName: getOriginalName(endpoint.name), reason: `Could not extract method call from snippet - likely service mismatch or invalid snippet format` }); continue; @@ -241,11 +244,11 @@ export class SdkWireTestGenerator { } catch (error) { const errorMessage = extractErrorMessage(error); this.context.logger.debug( - `Skipping endpoint ${endpoint.id} (${endpoint.name.originalName}): Failed to generate snippet - ${errorMessage}` + `Skipping endpoint ${endpoint.id} (${getOriginalName(endpoint.name)}): Failed to generate snippet - ${errorMessage}` ); skippedEndpoints.push({ endpointId: endpoint.id, - endpointName: endpoint.name.originalName, + endpointName: getOriginalName(endpoint.name), reason: `Snippet generation failed: ${errorMessage}` }); } @@ -266,11 +269,11 @@ export class SdkWireTestGenerator { const testMethodCall = snippetExtractor.extractMethodCall(fullSnippet); if (testMethodCall === null) { this.context.logger.debug( - `Skipping endpoint ${endpoint.id} (${endpoint.name.originalName}): Could not extract method call from default snippet` + `Skipping endpoint ${endpoint.id} (${getOriginalName(endpoint.name)}): Could not extract method call from default snippet` ); skippedEndpoints.push({ endpointId: endpoint.id, - endpointName: endpoint.name.originalName, + endpointName: getOriginalName(endpoint.name), reason: `Could not extract method call from default snippet - likely service mismatch or invalid snippet format` }); continue; @@ -289,11 +292,11 @@ export class SdkWireTestGenerator { } catch (error) { const errorMessage = extractErrorMessage(error); this.context.logger.debug( - `Skipping endpoint ${endpoint.id} (${endpoint.name.originalName}): Failed to generate default snippet - ${errorMessage}` + `Skipping endpoint ${endpoint.id} (${getOriginalName(endpoint.name)}): Failed to generate default snippet - ${errorMessage}` ); skippedEndpoints.push({ endpointId: endpoint.id, - endpointName: endpoint.name.originalName, + endpointName: getOriginalName(endpoint.name), reason: `Default snippet generation failed: ${errorMessage}` }); } @@ -358,7 +361,7 @@ export class SdkWireTestGenerator { testExample: WireTestExample ): string { const serviceNameLower = serviceName.toLowerCase(); - const methodName = endpoint.name.camelCase.safeName; + const methodName = this.context.caseConverter.camelSafe(endpoint.name); let pathParamsStr = ""; if (testExample.request.pathParams && Object.keys(testExample.request.pathParams).length > 0) { @@ -386,7 +389,9 @@ export class SdkWireTestGenerator { for (const service of Object.values(this.context.ir.services)) { const serviceName = - service.name?.fernFilepath?.allParts?.map((part) => part.pascalCase.safeName).join("") || "Service"; + service.name?.fernFilepath?.allParts + ?.map((part) => this.context.caseConverter.pascalSafe(part)) + .join("") || "Service"; endpointsByService.set(serviceName, service.endpoints); } @@ -530,7 +535,7 @@ export class SdkWireTestGenerator { transformedSnippet = transformedSnippet.replace(/Optional void { return (writer) => { - const testMethodName = `test${this.toJavaMethodName(endpoint.name.pascalCase.safeName)}`; + const testMethodName = `test${this.toJavaMethodName(this.context.caseConverter.pascalSafe(endpoint.name))}`; const methodCall = this.snippetExtractor.extractMethodCall(snippet); // If we can't extract a method call, this endpoint should have been filtered out upstream diff --git a/generators/java-v2/sdk/src/sdk-wire-tests/extractors/TestDataExtractor.ts b/generators/java-v2/sdk/src/sdk-wire-tests/extractors/TestDataExtractor.ts index a0b1f693c04e..fd155755bc7a 100644 --- a/generators/java-v2/sdk/src/sdk-wire-tests/extractors/TestDataExtractor.ts +++ b/generators/java-v2/sdk/src/sdk-wire-tests/extractors/TestDataExtractor.ts @@ -1,3 +1,4 @@ +import { getOriginalName, getWireValue } from "@fern-api/base-generator"; import { FernIr } from "@fern-fern/ir-sdk"; import { SdkGeneratorContext } from "../../SdkGeneratorContext.js"; @@ -43,7 +44,7 @@ export class WireTestDataExtractor { return { id: example.id || `${endpoint.id}-example`, - name: example.name?.originalName, + name: example.name != null ? getOriginalName(example.name) : undefined, request: { body: requestBody, headers: this.extractHeaders(example), @@ -80,7 +81,7 @@ export class WireTestDataExtractor { inlinedRequestBody: (value) => { const result: Record = {}; value.properties.forEach((p) => { - result[p.name.wireValue] = this.createRawJsonExample(p.value); + result[getWireValue(p.name)] = this.createRawJsonExample(p.value); }); return result; }, @@ -189,7 +190,7 @@ export class WireTestDataExtractor { const basePropertyWireNames = new Set(); unionShape.baseProperties.forEach((prop) => { - basePropertyWireNames.add(prop.name.wireValue); + basePropertyWireNames.add(getWireValue(prop.name)); }); const prunedBody: Record = {}; @@ -250,7 +251,7 @@ export class WireTestDataExtractor { const headers: Record = {}; [...(example.serviceHeaders ?? []), ...(example.endpointHeaders ?? [])].forEach((header) => { - headers[header.name.wireValue] = String(header.value.jsonExample); + headers[getWireValue(header.name)] = String(header.value.jsonExample); }); return headers; @@ -260,7 +261,7 @@ export class WireTestDataExtractor { const params: Record = {}; (example.queryParameters ?? []).forEach((param) => { - params[param.name.wireValue] = String(param.value.jsonExample); + params[getWireValue(param.name)] = String(param.value.jsonExample); }); return params; @@ -274,7 +275,7 @@ export class WireTestDataExtractor { ...(example.servicePathParameters ?? []), ...(example.endpointPathParameters ?? []) ].forEach((param) => { - params[param.name.originalName] = String(param.value.jsonExample); + params[getOriginalName(param.name)] = String(param.value.jsonExample); }); return params; diff --git a/generators/java-v2/sdk/src/utils/convertEndpointSnippetRequest.ts b/generators/java-v2/sdk/src/utils/convertEndpointSnippetRequest.ts index 27ae579ad2ad..25ef18090a3a 100644 --- a/generators/java-v2/sdk/src/utils/convertEndpointSnippetRequest.ts +++ b/generators/java-v2/sdk/src/utils/convertEndpointSnippetRequest.ts @@ -1,3 +1,4 @@ +import { getOriginalName, getWireValue } from "@fern-api/base-generator"; import { FernIr } from "@fern-fern/ir-sdk"; export type EndpointSnippetRequest = Omit & { baseURL: string | undefined; @@ -38,18 +39,18 @@ export function convertExampleEndpointCallToSnippetRequest( const pathParameters: Record = {}; [...example.rootPathParameters, ...example.servicePathParameters, ...example.endpointPathParameters].forEach( (param) => { - pathParameters[param.name.originalName] = param.value.jsonExample; + pathParameters[getOriginalName(param.name)] = param.value.jsonExample; } ); const queryParameters: Record = {}; example.queryParameters.forEach((param) => { - queryParameters[param.name.wireValue] = param.value.jsonExample; + queryParameters[getWireValue(param.name)] = param.value.jsonExample; }); const headers: Record = {}; [...example.serviceHeaders, ...example.endpointHeaders].forEach((header) => { - headers[header.name.wireValue] = header.value.jsonExample; + headers[getWireValue(header.name)] = header.value.jsonExample; }); return { diff --git a/generators/java/generator-utils/src/main/java/com/fern/java/AbstractGeneratorCli.java b/generators/java/generator-utils/src/main/java/com/fern/java/AbstractGeneratorCli.java index 0d9f2df6a9ff..023342a2a833 100644 --- a/generators/java/generator-utils/src/main/java/com/fern/java/AbstractGeneratorCli.java +++ b/generators/java/generator-utils/src/main/java/com/fern/java/AbstractGeneratorCli.java @@ -4,6 +4,9 @@ import static com.fern.java.GeneratorLogging.logError; import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.module.SimpleModule; import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.JsonNodeFactory; import com.fasterxml.jackson.databind.node.ObjectNode; @@ -20,6 +23,8 @@ import com.fern.generator.exec.model.logging.PackageCoordinate; import com.fern.generator.exec.model.logging.SuccessfulStatusUpdate; import com.fern.ir.core.ObjectMappers; +import com.fern.ir.model.commons.Name; +import com.fern.ir.model.commons.NameAndWireValue; import com.fern.ir.model.ir.IntermediateRepresentation; import com.fern.ir.model.publish.DirectPublish; import com.fern.ir.model.publish.Filesystem; @@ -37,6 +42,9 @@ import com.fern.java.output.gradle.GradlePlugin; import com.fern.java.output.gradle.GradlePublishingConfig; import com.fern.java.output.gradle.GradleRepository; +import com.fern.java.utils.CasingConfiguration; +import com.fern.java.utils.NameAndWireValueDeserializer; +import com.fern.java.utils.NameDeserializer; import java.io.File; import java.io.IOException; import java.nio.file.Files; @@ -93,7 +101,10 @@ private static GeneratorConfig getGeneratorConfig(String pluginPath) { } } - /** Loads and preprocesses the IR from file, handling integer overflow values. */ + /** + * Loads and preprocesses the IR from file, handling integer overflow values and v66 compressed name + * deserialization. + */ private static IntermediateRepresentation getIr(GeneratorConfig generatorConfig) { try { File irFile = new File(generatorConfig.getIrFilepath()); @@ -107,12 +118,39 @@ private static IntermediateRepresentation getIr(GeneratorConfig generatorConfig) log.info("Converted {} integer overflow value(s) to long type in IR", processor.getConversions()); } - return ObjectMappers.JSON_MAPPER.treeToValue(rootNode, IntermediateRepresentation.class); + // Extract casingsConfig from IR JSON before full deserialization, + // then register custom deserializers for v66 compressed names. + // The generated Name and NameAndWireValue classes have @JsonDeserialize(builder=...) + // annotations that take precedence over module-level addDeserializer() calls. + // We use mix-in annotations to override those class-level annotations, + // clearing the builder configuration so our custom deserializers are used instead. + CasingConfiguration casingConfig = CasingConfiguration.fromIrJson(rootNode); + + SimpleModule nameModule = new SimpleModule("NameOrStringModule"); + nameModule.addDeserializer(Name.class, new NameDeserializer(casingConfig)); + nameModule.addDeserializer(NameAndWireValue.class, new NameAndWireValueDeserializer(casingConfig)); + + ObjectMapper irMapper = ObjectMappers.JSON_MAPPER.copy(); + // Mix-in annotations override class-level @JsonDeserialize(builder=...) annotations, + // allowing the module-level custom deserializers to take effect. + irMapper.addMixIn(Name.class, NameOrStringMixIn.class); + irMapper.addMixIn(NameAndWireValue.class, NameOrStringMixIn.class); + irMapper.registerModule(nameModule); + + return irMapper.treeToValue(rootNode, IntermediateRepresentation.class); } catch (IOException e) { throw new RuntimeException("Failed to read ir", e); } } + /** + * Mix-in annotation class that overrides @JsonDeserialize(builder=...) on generated IR classes. When applied via + * ObjectMapper.addMixIn(), this clears the builder-based deserialization, allowing module-level custom + * deserializers to handle both v65 object and v66 string forms. + */ + @JsonDeserialize + abstract static class NameOrStringMixIn {} + /** Processes JSON nodes in-place to convert integer overflow values to long type. */ private static class IntegerOverflowProcessor { private int conversions = 0; diff --git a/generators/java/generator-utils/src/main/java/com/fern/java/utils/CasingConfiguration.java b/generators/java/generator-utils/src/main/java/com/fern/java/utils/CasingConfiguration.java new file mode 100644 index 000000000000..d345f943d2a5 --- /dev/null +++ b/generators/java/generator-utils/src/main/java/com/fern/java/utils/CasingConfiguration.java @@ -0,0 +1,475 @@ +package com.fern.java.utils; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fern.ir.model.commons.Name; +import com.fern.ir.model.commons.SafeAndUnsafeString; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Replicates the TypeScript CasingsGenerator's computeName logic in Java, handling: - camelCase, PascalCase, + * snake_case, SCREAMING_SNAKE_CASE conversions - smartCasing (smart snake_case that keeps numbers adjacent to letters: + * "v2" stays "v2") - initialism capitalization for Go/Ruby (not Java) - keyword sanitization + * + *

This is used by the custom Jackson deserializers to inflate compressed string names in v66 IR back into full Name + * objects that the v65 IR SDK expects. + */ +public final class CasingConfiguration { + + private static final Set COMMON_INITIALISMS = Set.of( + "ACL", "API", "ASCII", "CPU", "CSS", "DNS", "EOF", "GUID", "HTML", "HTTP", "HTTPS", "ID", "IP", "JSON", + "LHS", "QPS", "RAM", "RHS", "RPC", "SAML", "SCIM", "SLA", "SMTP", "SQL", "SSH", "SSO", "TCP", "TLS", "TTL", + "UDP", "UI", "UID", "UUID", "URI", "URL", "UTF8", "VM", "XML", "XMPP", "XSRF", "XSS"); + + private static final java.util.Map PLURAL_COMMON_INITIALISMS = java.util.Map.of( + "ACLS", "ACLs", "APIS", "APIs", "CPUS", "CPUs", "GUIDS", "GUIDs", "IDS", "IDs", "UIDS", "UIDs", "UUIDS", + "UUIDs", "URIS", "URIs", "URLS", "URLs"); + + private static final Set CAPITALIZE_INITIALISM_LANGUAGES = Set.of("go", "ruby"); + + private static final Pattern STARTS_WITH_NUMBER = Pattern.compile("^[0-9]"); + + // Match lodash words() regex: [A-Z]+(?=[A-Z][a-z])|[A-Z]?[a-z]+|[A-Z]+|[0-9]+ + private static final Pattern SPLIT_WORDS_PATTERN = + Pattern.compile("[A-Z]+(?=[A-Z][a-z])|[A-Z]?[a-z]+|[A-Z]+|[0-9]+"); + + // Java reserved keywords for keyword sanitization + private static final Set JAVA_RESERVED_KEYWORDS = Set.of( + "abstract", + "assert", + "boolean", + "break", + "byte", + "case", + "catch", + "char", + "class", + "const", + "continue", + "default", + "do", + "double", + "else", + "enum", + "extends", + "final", + "finally", + "float", + "for", + "goto", + "if", + "implements", + "import", + "instanceof", + "int", + "interface", + "long", + "native", + "new", + "package", + "private", + "protected", + "public", + "return", + "short", + "static", + "strictfp", + "super", + "switch", + "synchronized", + "this", + "throw", + "throws", + "transient", + "try", + "void", + "volatile", + "while"); + + private final boolean smartCasing; + private final String generationLanguage; + private final Set keywords; + private final Map nameCache = new HashMap<>(); + + private CasingConfiguration(boolean smartCasing, String generationLanguage, Set keywords) { + this.smartCasing = smartCasing; + this.generationLanguage = generationLanguage; + this.keywords = keywords; + } + + /** + * Extracts the casingsConfig from the IR JSON root node and constructs a CasingConfiguration. Mirrors the + * TypeScript constructFullCasingsGenerator behavior. + */ + public static CasingConfiguration fromIrJson(JsonNode rootNode) { + boolean smartCasing = true; // default to true, matching latest CLI behavior + String generationLanguage = null; + Set keywords = null; + + JsonNode casingsConfig = rootNode.get("casingsConfig"); + if (casingsConfig != null && !casingsConfig.isNull()) { + JsonNode smartCasingNode = casingsConfig.get("smartCasing"); + if (smartCasingNode != null && !smartCasingNode.isNull()) { + smartCasing = smartCasingNode.asBoolean(true); + } + + JsonNode langNode = casingsConfig.get("generationLanguage"); + if (langNode != null && !langNode.isNull() && langNode.isTextual()) { + generationLanguage = langNode.asText(); + } + + JsonNode keywordsNode = casingsConfig.get("keywords"); + if (keywordsNode != null && !keywordsNode.isNull() && keywordsNode.isArray()) { + keywords = new HashSet<>(); + for (JsonNode kw : keywordsNode) { + keywords.add(kw.asText()); + } + } + } + + return new CasingConfiguration(smartCasing, generationLanguage, keywords); + } + + /** + * Computes a full Name JSON-equivalent from a plain string, replicating TypeScript's computeName. Returns a + * NameParts object with all casing variants. + */ + public NameParts computeName(String inputName) { + NameParts cached = nameCache.get(inputName); + if (cached != null) { + return cached; + } + NameParts result = computeNameInternal(inputName); + nameCache.put(inputName, result); + return result; + } + + private NameParts computeNameInternal(String inputName) { + String name = preprocessName(inputName); + + String camelCaseName = toCamelCase(name); + String pascalCaseName = upperFirst(camelCaseName); + String snakeCaseName; + + if (smartCasing) { + snakeCaseName = toSmartSnakeCase(name); + } else { + snakeCaseName = toBasicSnakeCase(name); + } + String screamingSnakeCaseName = snakeCaseName.toUpperCase(); + + // Apply initialism casing only when smartCasing is enabled and + // the generation language is in the CAPITALIZE_INITIALISM list. + if (smartCasing + && (generationLanguage == null || CAPITALIZE_INITIALISM_LANGUAGES.contains(generationLanguage))) { + List camelWords = splitWords(camelCaseName); + if (!hasAdjacentCommonInitialisms(camelWords)) { + camelCaseName = applyInitialismsCamel(camelWords); + pascalCaseName = applyInitialismsPascal(camelWords); + } + } + + return new NameParts( + inputName, + camelCaseName, + sanitizeName(camelCaseName), + pascalCaseName, + sanitizeName(pascalCaseName), + snakeCaseName, + sanitizeName(snakeCaseName), + screamingSnakeCaseName, + sanitizeName(screamingSnakeCaseName)); + } + + private String preprocessName(String name) { + return name.replace("[]", "Array"); + } + + private String sanitizeName(String name) { + Set effectiveKeywords = getEffectiveKeywords(); + if (effectiveKeywords == null) { + return name; + } + if (effectiveKeywords.contains(name)) { + return name + "_"; + } + if (STARTS_WITH_NUMBER.matcher(name).find()) { + return "_" + name; + } + return name; + } + + private Set getEffectiveKeywords() { + if (keywords != null) { + return keywords; + } + if (generationLanguage != null) { + return getDefaultKeywordsForLanguage(generationLanguage); + } + return null; + } + + private static Set getDefaultKeywordsForLanguage(String lang) { + if ("java".equals(lang)) { + return JAVA_RESERVED_KEYWORDS; + } + // For other languages, no default keywords defined in Java v1. + // The Java v1 generator only runs for Java. + return null; + } + + // ===== Casing conversion methods ===== + + /** + * Splits a string into words, matching lodash's words() behavior. Uses the same regex pattern: + * [A-Z]+(?=[A-Z][a-z])|[A-Z]?[a-z]+|[A-Z]+|[0-9]+ + * + *

Examples: "AValue" -> ["A", "Value"] "HTTPSClient" -> ["HTTPS", "Client"] "userId" -> ["user", "Id"] + * "XMLParser" -> ["XML", "Parser"] "ABCDef" -> ["ABC", "Def"] "AB" -> ["AB"] + */ + static List splitWords(String s) { + if (s == null || s.isEmpty()) { + return Collections.emptyList(); + } + + Matcher matcher = SPLIT_WORDS_PATTERN.matcher(s); + List words = new ArrayList<>(); + while (matcher.find()) { + words.add(matcher.group()); + } + return words; + } + + static String toCamelCase(String s) { + List words = splitWords(s); + if (words.isEmpty()) { + return ""; + } + StringBuilder result = new StringBuilder(); + for (int i = 0; i < words.size(); i++) { + if (i == 0) { + result.append(words.get(i).toLowerCase()); + } else { + result.append(upperFirst(words.get(i).toLowerCase())); + } + } + return result.toString(); + } + + static String toPascalCase(String s) { + List words = splitWords(s); + if (words.isEmpty()) { + return ""; + } + StringBuilder result = new StringBuilder(); + for (String word : words) { + result.append(upperFirst(word.toLowerCase())); + } + return result.toString(); + } + + static String toBasicSnakeCase(String s) { + List words = splitWords(s); + if (words.isEmpty()) { + return ""; + } + List lowered = new ArrayList<>(); + for (String w : words) { + lowered.add(w.toLowerCase()); + } + return String.join("_", lowered); + } + + /** + * Smart snake_case: keeps numbers adjacent to letters ("v2" stays "v2" instead of "v_2"). Matches TypeScript: split + * on spaces, then each part split on digits, snake_case each non-digit segment. + */ + static String toSmartSnakeCase(String s) { + String[] spaceParts = s.split(" "); + List snakeParts = new ArrayList<>(); + for (String part : spaceParts) { + List segments = splitByDigits(part); + StringBuilder partResult = new StringBuilder(); + for (String seg : segments) { + if (!seg.isEmpty() && seg.charAt(0) >= '0' && seg.charAt(0) <= '9') { + partResult.append(seg); + } else { + partResult.append(toBasicSnakeCase(seg)); + } + } + snakeParts.add(partResult.toString()); + } + return String.join("_", snakeParts); + } + + static List splitByDigits(String s) { + List segments = new ArrayList<>(); + StringBuilder current = new StringBuilder(); + boolean inDigits = false; + for (char c : s.toCharArray()) { + boolean isDigit = c >= '0' && c <= '9'; + if (current.length() > 0 && isDigit != inDigits) { + segments.add(current.toString()); + current.setLength(0); + } + inDigits = isDigit; + current.append(c); + } + if (current.length() > 0) { + segments.add(current.toString()); + } + return segments; + } + + static String upperFirst(String s) { + if (s == null || s.isEmpty()) { + return s; + } + return Character.toUpperCase(s.charAt(0)) + s.substring(1); + } + + private static boolean isCommonInitialism(String word) { + return COMMON_INITIALISMS.contains(word.toUpperCase()); + } + + private static String maybeGetPluralInitialism(String word) { + return PLURAL_COMMON_INITIALISMS.get(word.toUpperCase()); + } + + private static boolean hasAdjacentCommonInitialisms(List wordList) { + for (int i = 1; i < wordList.size(); i++) { + String prev = wordList.get(i - 1); + String curr = wordList.get(i); + boolean prevIsInit = isCommonInitialism(prev) || maybeGetPluralInitialism(prev) != null; + boolean currIsInit = isCommonInitialism(curr) || maybeGetPluralInitialism(curr) != null; + if (prevIsInit && currIsInit) { + return true; + } + } + return false; + } + + private static String applyInitialismsCamel(List camelWords) { + StringBuilder result = new StringBuilder(); + for (int i = 0; i < camelWords.size(); i++) { + String word = camelWords.get(i); + if (i > 0) { + String plural = maybeGetPluralInitialism(word); + if (plural != null) { + result.append(plural); + continue; + } + if (isCommonInitialism(word)) { + result.append(word.toUpperCase()); + continue; + } + } + result.append(word); + } + return result.toString(); + } + + private static String applyInitialismsPascal(List camelWords) { + StringBuilder result = new StringBuilder(); + for (int i = 0; i < camelWords.size(); i++) { + String word = camelWords.get(i); + String plural = maybeGetPluralInitialism(word); + if (plural != null) { + result.append(plural); + continue; + } + if (isCommonInitialism(word)) { + result.append(word.toUpperCase()); + continue; + } + if (i == 0) { + result.append(upperFirst(word)); + } else { + result.append(word); + } + } + return result.toString(); + } + + /** Builds a Name IR object from a JSON object node (v65 full form). */ + static Name nameFromObjectNode(JsonNode node) { + return Name.builder() + .originalName(node.get("originalName").asText()) + .camelCase(safeAndUnsafeFromNode(node.get("camelCase"))) + .pascalCase(safeAndUnsafeFromNode(node.get("pascalCase"))) + .snakeCase(safeAndUnsafeFromNode(node.get("snakeCase"))) + .screamingSnakeCase(safeAndUnsafeFromNode(node.get("screamingSnakeCase"))) + .build(); + } + + static SafeAndUnsafeString safeAndUnsafeFromNode(JsonNode node) { + return SafeAndUnsafeString.builder() + .unsafeName(node.get("unsafeName").asText()) + .safeName(node.get("safeName").asText()) + .build(); + } + + /** Holds all casing variants for a name, used to construct the full Name JSON object. */ + public static final class NameParts { + public final String originalName; + public final String camelUnsafe; + public final String camelSafe; + public final String pascalUnsafe; + public final String pascalSafe; + public final String snakeUnsafe; + public final String snakeSafe; + public final String screamingSnakeUnsafe; + public final String screamingSnakeSafe; + + NameParts( + String originalName, + String camelUnsafe, + String camelSafe, + String pascalUnsafe, + String pascalSafe, + String snakeUnsafe, + String snakeSafe, + String screamingSnakeUnsafe, + String screamingSnakeSafe) { + this.originalName = originalName; + this.camelUnsafe = camelUnsafe; + this.camelSafe = camelSafe; + this.pascalUnsafe = pascalUnsafe; + this.pascalSafe = pascalSafe; + this.snakeUnsafe = snakeUnsafe; + this.snakeSafe = snakeSafe; + this.screamingSnakeUnsafe = screamingSnakeUnsafe; + this.screamingSnakeSafe = screamingSnakeSafe; + } + + /** Converts these casing variants into a Name IR object. */ + public Name toName() { + return Name.builder() + .originalName(originalName) + .camelCase(SafeAndUnsafeString.builder() + .unsafeName(camelUnsafe) + .safeName(camelSafe) + .build()) + .pascalCase(SafeAndUnsafeString.builder() + .unsafeName(pascalUnsafe) + .safeName(pascalSafe) + .build()) + .snakeCase(SafeAndUnsafeString.builder() + .unsafeName(snakeUnsafe) + .safeName(snakeSafe) + .build()) + .screamingSnakeCase(SafeAndUnsafeString.builder() + .unsafeName(screamingSnakeUnsafe) + .safeName(screamingSnakeSafe) + .build()) + .build(); + } + } +} diff --git a/generators/java/generator-utils/src/main/java/com/fern/java/utils/NameAndWireValueDeserializer.java b/generators/java/generator-utils/src/main/java/com/fern/java/utils/NameAndWireValueDeserializer.java new file mode 100644 index 000000000000..0d6cd344555f --- /dev/null +++ b/generators/java/generator-utils/src/main/java/com/fern/java/utils/NameAndWireValueDeserializer.java @@ -0,0 +1,58 @@ +package com.fern.java.utils; + +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonNode; +import com.fern.ir.model.commons.Name; +import com.fern.ir.model.commons.NameAndWireValue; +import java.io.IOException; + +/** + * Custom Jackson deserializer for {@link NameAndWireValue} that handles both: + * + *

    + *
  • v65 object form: {@code {"wireValue": "...", "name": {...}}} + *
  • v66 compressed string form: {@code "myFieldName"} (wireValue == name) + *
  • v66 partial object form: {@code {"wireValue": "...", "name": "..."}} (name is a string) + *
+ * + * When a string is encountered, the string serves as both the wireValue and the name. Uses {@link CasingConfiguration} + * to compute full Name from a string. + */ +public final class NameAndWireValueDeserializer extends JsonDeserializer { + + private final CasingConfiguration casingConfig; + + public NameAndWireValueDeserializer(CasingConfiguration casingConfig) { + this.casingConfig = casingConfig; + } + + @Override + public NameAndWireValue deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + if (p.currentToken() == JsonToken.VALUE_STRING) { + String input = p.getText(); + return NameAndWireValue.builder() + .wireValue(input) + .name(casingConfig.computeName(input).toName()) + .build(); + } + JsonNode node = p.readValueAsTree(); + return nameAndWireValueFromObjectNode(node); + } + + private NameAndWireValue nameAndWireValueFromObjectNode(JsonNode node) { + String wireValue = node.get("wireValue").asText(); + JsonNode nameNode = node.get("name"); + + Name name; + if (nameNode.isTextual()) { + name = casingConfig.computeName(nameNode.asText()).toName(); + } else { + name = CasingConfiguration.nameFromObjectNode(nameNode); + } + + return NameAndWireValue.builder().wireValue(wireValue).name(name).build(); + } +} diff --git a/generators/java/generator-utils/src/main/java/com/fern/java/utils/NameDeserializer.java b/generators/java/generator-utils/src/main/java/com/fern/java/utils/NameDeserializer.java new file mode 100644 index 000000000000..92919f61a867 --- /dev/null +++ b/generators/java/generator-utils/src/main/java/com/fern/java/utils/NameDeserializer.java @@ -0,0 +1,36 @@ +package com.fern.java.utils; + +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fern.ir.model.commons.Name; +import java.io.IOException; + +/** + * Custom Jackson deserializer for {@link Name} that handles both: + * + *
    + *
  • v65 object form: {@code {"originalName": "...", "camelCase": {...}, ...}} + *
  • v66 compressed string form: {@code "myFieldName"} + *
+ * + * When a string is encountered, uses {@link CasingConfiguration} to compute all casing variants, replicating the + * TypeScript CasingsGenerator's computeName behavior. + */ +public final class NameDeserializer extends JsonDeserializer { + + private final CasingConfiguration casingConfig; + + public NameDeserializer(CasingConfiguration casingConfig) { + this.casingConfig = casingConfig; + } + + @Override + public Name deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + if (p.currentToken() == JsonToken.VALUE_STRING) { + return casingConfig.computeName(p.getText()).toName(); + } + return CasingConfiguration.nameFromObjectNode(p.readValueAsTree()); + } +} diff --git a/generators/java/generator-utils/src/test/java/com/fern/java/utils/CasingConfigurationTest.java b/generators/java/generator-utils/src/test/java/com/fern/java/utils/CasingConfigurationTest.java new file mode 100644 index 000000000000..760e9510e081 --- /dev/null +++ b/generators/java/generator-utils/src/test/java/com/fern/java/utils/CasingConfigurationTest.java @@ -0,0 +1,935 @@ +package com.fern.java.utils; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.List; +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.CsvSource; + +public class CasingConfigurationTest { + + // ===== splitWords ===== + + @Nested + class SplitWordsTests { + + @Test + void splitWords_camelCase() { + assertThat(CasingConfiguration.splitWords("userId")).containsExactly("user", "Id"); + } + + @Test + void splitWords_pascalCase() { + assertThat(CasingConfiguration.splitWords("UserId")).containsExactly("User", "Id"); + } + + @Test + void splitWords_allCaps() { + assertThat(CasingConfiguration.splitWords("HTTP")).containsExactly("HTTP"); + } + + @Test + void splitWords_allCapsFollowedByLower() { + assertThat(CasingConfiguration.splitWords("HTTPSClient")).containsExactly("HTTPS", "Client"); + } + + @Test + void splitWords_singleChar() { + assertThat(CasingConfiguration.splitWords("A")).containsExactly("A"); + } + + @Test + void splitWords_singleLowerChar() { + assertThat(CasingConfiguration.splitWords("a")).containsExactly("a"); + } + + @Test + void splitWords_mixed() { + assertThat(CasingConfiguration.splitWords("ABCDef")).containsExactly("ABC", "Def"); + } + + @Test + void splitWords_twoCaps() { + assertThat(CasingConfiguration.splitWords("AB")).containsExactly("AB"); + } + + @Test + void splitWords_AValue() { + assertThat(CasingConfiguration.splitWords("AValue")).containsExactly("A", "Value"); + } + + @Test + void splitWords_XMLParser() { + assertThat(CasingConfiguration.splitWords("XMLParser")).containsExactly("XML", "Parser"); + } + + @Test + void splitWords_withNumbers() { + assertThat(CasingConfiguration.splitWords("test123")).containsExactly("test", "123"); + } + + @Test + void splitWords_numbersOnly() { + assertThat(CasingConfiguration.splitWords("123")).containsExactly("123"); + } + + @Test + void splitWords_v2() { + assertThat(CasingConfiguration.splitWords("v2")).containsExactly("v", "2"); + } + + @Test + void splitWords_applicationV1() { + assertThat(CasingConfiguration.splitWords("applicationV1")).containsExactly("application", "V", "1"); + } + + @Test + void splitWords_emptyString() { + assertThat(CasingConfiguration.splitWords("")).isEmpty(); + } + + @Test + void splitWords_null() { + assertThat(CasingConfiguration.splitWords(null)).isEmpty(); + } + + @Test + void splitWords_onlySpecialChars() { + // underscores and hyphens are not matched by the pattern + assertThat(CasingConfiguration.splitWords("___")).isEmpty(); + } + + @Test + void splitWords_snakeCase() { + assertThat(CasingConfiguration.splitWords("user_id")).containsExactly("user", "id"); + } + + @Test + void splitWords_ec2() { + assertThat(CasingConfiguration.splitWords("ec2")).containsExactly("ec", "2"); + } + + @Test + void splitWords_test2This2() { + assertThat(CasingConfiguration.splitWords("test2This2")).containsExactly("test", "2", "This", "2"); + } + } + + // ===== toCamelCase ===== + + @Nested + class ToCamelCaseTests { + + @Test + void toCamelCase_pascalCase() { + assertThat(CasingConfiguration.toCamelCase("UserId")).isEqualTo("userId"); + } + + @Test + void toCamelCase_alreadyCamel() { + assertThat(CasingConfiguration.toCamelCase("userId")).isEqualTo("userId"); + } + + @Test + void toCamelCase_allCaps() { + assertThat(CasingConfiguration.toCamelCase("HTTP")).isEqualTo("http"); + } + + @Test + void toCamelCase_mixed() { + assertThat(CasingConfiguration.toCamelCase("HTTPSClient")).isEqualTo("httpsClient"); + } + + @Test + void toCamelCase_snakeCase() { + assertThat(CasingConfiguration.toCamelCase("user_id")).isEqualTo("userId"); + } + + @Test + void toCamelCase_singleWord() { + assertThat(CasingConfiguration.toCamelCase("hello")).isEqualTo("hello"); + } + + @Test + void toCamelCase_empty() { + assertThat(CasingConfiguration.toCamelCase("")).isEqualTo(""); + } + + @Test + void toCamelCase_singleUpperChar() { + assertThat(CasingConfiguration.toCamelCase("A")).isEqualTo("a"); + } + + @Test + void toCamelCase_withNumbers() { + assertThat(CasingConfiguration.toCamelCase("test123Value")).isEqualTo("test123Value"); + } + } + + // ===== toPascalCase ===== + + @Nested + class ToPascalCaseTests { + + @Test + void toPascalCase_camelCase() { + assertThat(CasingConfiguration.toPascalCase("userId")).isEqualTo("UserId"); + } + + @Test + void toPascalCase_alreadyPascal() { + assertThat(CasingConfiguration.toPascalCase("UserId")).isEqualTo("UserId"); + } + + @Test + void toPascalCase_allCaps() { + assertThat(CasingConfiguration.toPascalCase("HTTP")).isEqualTo("Http"); + } + + @Test + void toPascalCase_mixed() { + assertThat(CasingConfiguration.toPascalCase("HTTPSClient")).isEqualTo("HttpsClient"); + } + + @Test + void toPascalCase_snakeCase() { + assertThat(CasingConfiguration.toPascalCase("user_id")).isEqualTo("UserId"); + } + + @Test + void toPascalCase_empty() { + assertThat(CasingConfiguration.toPascalCase("")).isEqualTo(""); + } + + @Test + void toPascalCase_singleLowerChar() { + assertThat(CasingConfiguration.toPascalCase("a")).isEqualTo("A"); + } + } + + // ===== toBasicSnakeCase ===== + + @Nested + class ToBasicSnakeCaseTests { + + @Test + void toBasicSnakeCase_camelCase() { + assertThat(CasingConfiguration.toBasicSnakeCase("userId")).isEqualTo("user_id"); + } + + @Test + void toBasicSnakeCase_pascalCase() { + assertThat(CasingConfiguration.toBasicSnakeCase("UserId")).isEqualTo("user_id"); + } + + @Test + void toBasicSnakeCase_alreadySnake() { + assertThat(CasingConfiguration.toBasicSnakeCase("user_id")).isEqualTo("user_id"); + } + + @Test + void toBasicSnakeCase_allCaps() { + assertThat(CasingConfiguration.toBasicSnakeCase("HTTP")).isEqualTo("http"); + } + + @Test + void toBasicSnakeCase_v2() { + assertThat(CasingConfiguration.toBasicSnakeCase("v2")).isEqualTo("v_2"); + } + + @Test + void toBasicSnakeCase_ec2() { + assertThat(CasingConfiguration.toBasicSnakeCase("ec2")).isEqualTo("ec_2"); + } + + @Test + void toBasicSnakeCase_empty() { + assertThat(CasingConfiguration.toBasicSnakeCase("")).isEqualTo(""); + } + } + + // ===== toSmartSnakeCase ===== + + @Nested + class ToSmartSnakeCaseTests { + + @Test + void toSmartSnakeCase_v2() { + assertThat(CasingConfiguration.toSmartSnakeCase("v2")).isEqualTo("v2"); + } + + @Test + void toSmartSnakeCase_ec2() { + assertThat(CasingConfiguration.toSmartSnakeCase("ec2")).isEqualTo("ec2"); + } + + @Test + void toSmartSnakeCase_applicationV1() { + assertThat(CasingConfiguration.toSmartSnakeCase("applicationV1")).isEqualTo("application_v1"); + } + + @Test + void toSmartSnakeCase_test2This2() { + // "test2This2" -> splitByDigits: "test", "2", "This", "2" + // non-digit parts: basicSnake("test") = "test", basicSnake("This") = "this" + // result: "test2this2" + assertThat(CasingConfiguration.toSmartSnakeCase("test2This2")).isEqualTo("test2this2"); + } + + @Test + void toSmartSnakeCase_test2This2_2v22() { + // "test2This2 2v22" -> space split: ["test2This2", "2v22"] + // "test2This2" -> "test2this2" + // "2v22" -> splitByDigits: "2", "v", "22" -> "2v22" + // join with "_": "test2this2_2v22" + assertThat(CasingConfiguration.toSmartSnakeCase("test2This2 2v22")).isEqualTo("test2this2_2v22"); + } + + @Test + void toSmartSnakeCase_simpleWord() { + assertThat(CasingConfiguration.toSmartSnakeCase("hello")).isEqualTo("hello"); + } + + @Test + void toSmartSnakeCase_camelCase() { + assertThat(CasingConfiguration.toSmartSnakeCase("helloWorld")).isEqualTo("hello_world"); + } + + @Test + void toSmartSnakeCase_withSpaces() { + assertThat(CasingConfiguration.toSmartSnakeCase("hello world")).isEqualTo("hello_world"); + } + + @Test + void toSmartSnakeCase_numbersOnly() { + assertThat(CasingConfiguration.toSmartSnakeCase("123")).isEqualTo("123"); + } + } + + // ===== splitByDigits ===== + + @Nested + class SplitByDigitsTests { + + @Test + void splitByDigits_noDigits() { + assertThat(CasingConfiguration.splitByDigits("hello")).containsExactly("hello"); + } + + @Test + void splitByDigits_onlyDigits() { + assertThat(CasingConfiguration.splitByDigits("123")).containsExactly("123"); + } + + @Test + void splitByDigits_mixed() { + assertThat(CasingConfiguration.splitByDigits("v2")).containsExactly("v", "2"); + } + + @Test + void splitByDigits_complexMixed() { + assertThat(CasingConfiguration.splitByDigits("test123value456")) + .containsExactly("test", "123", "value", "456"); + } + + @Test + void splitByDigits_empty() { + assertThat(CasingConfiguration.splitByDigits("")).isEmpty(); + } + + @Test + void splitByDigits_leadingDigits() { + assertThat(CasingConfiguration.splitByDigits("2v")).containsExactly("2", "v"); + } + } + + // ===== upperFirst ===== + + @Nested + class UpperFirstTests { + + @Test + void upperFirst_lowercase() { + assertThat(CasingConfiguration.upperFirst("hello")).isEqualTo("Hello"); + } + + @Test + void upperFirst_alreadyUpper() { + assertThat(CasingConfiguration.upperFirst("Hello")).isEqualTo("Hello"); + } + + @Test + void upperFirst_singleChar() { + assertThat(CasingConfiguration.upperFirst("a")).isEqualTo("A"); + } + + @Test + void upperFirst_empty() { + assertThat(CasingConfiguration.upperFirst("")).isEqualTo(""); + } + + @Test + void upperFirst_null() { + assertThat(CasingConfiguration.upperFirst(null)).isNull(); + } + } + + // ===== computeName (full integration) ===== + + @Nested + class ComputeNameTests { + + // --- Basic casing (smartCasing=false, no language, no keywords) --- + + @Test + void computeName_basic_normalName() { + CasingConfiguration config = buildConfig(false, null, null); + CasingConfiguration.NameParts parts = config.computeName("normalName"); + + assertThat(parts.originalName).isEqualTo("normalName"); + assertThat(parts.camelUnsafe).isEqualTo("normalName"); + assertThat(parts.pascalUnsafe).isEqualTo("NormalName"); + assertThat(parts.snakeUnsafe).isEqualTo("normal_name"); + assertThat(parts.screamingSnakeUnsafe).isEqualTo("NORMAL_NAME"); + } + + @Test + void computeName_basic_userId() { + CasingConfiguration config = buildConfig(false, null, null); + CasingConfiguration.NameParts parts = config.computeName("userId"); + + assertThat(parts.originalName).isEqualTo("userId"); + assertThat(parts.camelUnsafe).isEqualTo("userId"); + assertThat(parts.pascalUnsafe).isEqualTo("UserId"); + assertThat(parts.snakeUnsafe).isEqualTo("user_id"); + assertThat(parts.screamingSnakeUnsafe).isEqualTo("USER_ID"); + } + + @Test + void computeName_basic_PascalInput() { + CasingConfiguration config = buildConfig(false, null, null); + CasingConfiguration.NameParts parts = config.computeName("UserId"); + + assertThat(parts.camelUnsafe).isEqualTo("userId"); + assertThat(parts.pascalUnsafe).isEqualTo("UserId"); + assertThat(parts.snakeUnsafe).isEqualTo("user_id"); + } + + @Test + void computeName_basic_allCaps() { + CasingConfiguration config = buildConfig(false, null, null); + CasingConfiguration.NameParts parts = config.computeName("HTTP"); + + assertThat(parts.camelUnsafe).isEqualTo("http"); + assertThat(parts.pascalUnsafe).isEqualTo("Http"); + assertThat(parts.snakeUnsafe).isEqualTo("http"); + } + + @Test + void computeName_basic_v2_noSmartCasing() { + CasingConfiguration config = buildConfig(false, null, null); + CasingConfiguration.NameParts parts = config.computeName("v2"); + + // Without smartCasing, basicSnakeCase splits "v" and "2" + assertThat(parts.snakeUnsafe).isEqualTo("v_2"); + assertThat(parts.screamingSnakeUnsafe).isEqualTo("V_2"); + } + + // --- smartCasing (no language = initialism capitalization ON by default) --- + + @Test + void computeName_smart_v2() { + CasingConfiguration config = buildConfig(true, null, null); + CasingConfiguration.NameParts parts = config.computeName("v2"); + + // smartCasing keeps numbers adjacent: "v2" not "v_2" + assertThat(parts.snakeUnsafe).isEqualTo("v2"); + assertThat(parts.screamingSnakeUnsafe).isEqualTo("V2"); + } + + @Test + void computeName_smart_ec2() { + CasingConfiguration config = buildConfig(true, null, null); + CasingConfiguration.NameParts parts = config.computeName("ec2"); + + assertThat(parts.snakeUnsafe).isEqualTo("ec2"); + assertThat(parts.screamingSnakeUnsafe).isEqualTo("EC2"); + } + + @Test + void computeName_smart_applicationV1() { + CasingConfiguration config = buildConfig(true, null, null); + CasingConfiguration.NameParts parts = config.computeName("applicationV1"); + + assertThat(parts.snakeUnsafe).isEqualTo("application_v1"); + assertThat(parts.screamingSnakeUnsafe).isEqualTo("APPLICATION_V1"); + } + + @Test + void computeName_smart_test2This2_2v22() { + CasingConfiguration config = buildConfig(true, null, null); + CasingConfiguration.NameParts parts = config.computeName("test2This2 2v22"); + + assertThat(parts.snakeUnsafe).isEqualTo("test2this2_2v22"); + } + + // --- smartCasing + initialism capitalization (Go language) --- + + @Test + void computeName_smartGo_userId() { + CasingConfiguration config = buildConfig(true, "go", null); + CasingConfiguration.NameParts parts = config.computeName("userId"); + + // "Id" is a common initialism -> camelCase keeps first word, capitalizes "Id" -> "ID" + assertThat(parts.camelUnsafe).isEqualTo("userID"); + assertThat(parts.pascalUnsafe).isEqualTo("UserID"); + } + + @Test + void computeName_smartGo_httpClient() { + CasingConfiguration config = buildConfig(true, "go", null); + CasingConfiguration.NameParts parts = config.computeName("httpClient"); + + // "Http" -> not at index 0 for camel => at index 1 "Client" is not initialism + // splitWords("httpClient") = ["http", "Client"] + // camelCase("httpClient") = "httpClient" + // splitWords("httpClient") = ["http", "Client"] + // index 0: "http" -> keep as-is (index 0 in camel) + // index 1: "Client" -> not initialism -> keep + // But "http" IS a common initialism (HTTP) + // In camel: index 0 is kept as-is, only index > 0 gets uppercased + assertThat(parts.camelUnsafe).isEqualTo("httpClient"); + assertThat(parts.pascalUnsafe).isEqualTo("HTTPClient"); + } + + @Test + void computeName_smartGo_getHttpResponse() { + CasingConfiguration config = buildConfig(true, "go", null); + CasingConfiguration.NameParts parts = config.computeName("getHttpResponse"); + + // camelCase("getHttpResponse") = "getHttpResponse" + // words: ["get", "Http", "Response"] + // index 0: "get" -> keep (not initialism at index 0) + // index 1: "Http" -> isCommonInitialism("HTTP") = true -> "HTTP" + // index 2: "Response" -> not initialism + assertThat(parts.camelUnsafe).isEqualTo("getHTTPResponse"); + assertThat(parts.pascalUnsafe).isEqualTo("GetHTTPResponse"); + } + + @Test + void computeName_smartGo_apiKey() { + CasingConfiguration config = buildConfig(true, "go", null); + CasingConfiguration.NameParts parts = config.computeName("apiKey"); + + // camelCase("apiKey") = "apiKey" + // words: ["api", "Key"] + // index 0: "api" -> keep as-is in camel + // index 1: "Key" -> not an initialism + assertThat(parts.camelUnsafe).isEqualTo("apiKey"); + // pascal: index 0 "api" -> upperFirst("api") = "Api" -> isCommonInitialism("API") -> "API" + assertThat(parts.pascalUnsafe).isEqualTo("APIKey"); + } + + @Test + void computeName_smartGo_setClientId() { + CasingConfiguration config = buildConfig(true, "go", null); + CasingConfiguration.NameParts parts = config.computeName("setClientId"); + + // camelCase("setClientId") = "setClientId" + // words: ["set", "Client", "Id"] + // index 0: "set" -> keep + // index 1: "Client" -> not initialism + // index 2: "Id" -> isCommonInitialism("ID") = true -> "ID" + assertThat(parts.camelUnsafe).isEqualTo("setClientID"); + assertThat(parts.pascalUnsafe).isEqualTo("SetClientID"); + } + + @Test + void computeName_smartGo_pluralInitialism_userIds() { + CasingConfiguration config = buildConfig(true, "go", null); + CasingConfiguration.NameParts parts = config.computeName("userIds"); + + // camelCase("userIds") = "userIds" + // words: ["user", "Ids"] + // index 1: "Ids" -> maybeGetPluralInitialism("IDS") = "IDs" + assertThat(parts.camelUnsafe).isEqualTo("userIDs"); + assertThat(parts.pascalUnsafe).isEqualTo("UserIDs"); + } + + @Test + void computeName_smartGo_pluralInitialism_apiUuids() { + CasingConfiguration config = buildConfig(true, "go", null); + CasingConfiguration.NameParts parts = config.computeName("apiUuids"); + + // camelCase("apiUuids") = "apiUuids" + // words: ["api", "Uuids"] + // Both "api" and "Uuids" are initialisms -> hasAdjacentCommonInitialisms = true + // So NO initialism transformation is applied + assertThat(parts.camelUnsafe).isEqualTo("apiUuids"); + assertThat(parts.pascalUnsafe).isEqualTo("ApiUuids"); + } + + @Test + void computeName_smartGo_adjacentInitialisms_httpUrl() { + CasingConfiguration config = buildConfig(true, "go", null); + CasingConfiguration.NameParts parts = config.computeName("httpUrl"); + + // camelCase("httpUrl") = "httpUrl" + // words: ["http", "Url"] + // "http" -> isCommonInitialism("HTTP") = true + // "Url" -> isCommonInitialism("URL") = true + // Adjacent initialisms -> skip transformation + assertThat(parts.camelUnsafe).isEqualTo("httpUrl"); + assertThat(parts.pascalUnsafe).isEqualTo("HttpUrl"); + } + + // --- smartCasing + Ruby (also gets initialism capitalization) --- + + @Test + void computeName_smartRuby_userId() { + CasingConfiguration config = buildConfig(true, "ruby", null); + CasingConfiguration.NameParts parts = config.computeName("userId"); + + assertThat(parts.camelUnsafe).isEqualTo("userID"); + assertThat(parts.pascalUnsafe).isEqualTo("UserID"); + } + + // --- smartCasing + Java (no initialism capitalization) --- + + @Test + void computeName_smartJava_userId() { + CasingConfiguration config = buildConfig(true, "java", null); + CasingConfiguration.NameParts parts = config.computeName("userId"); + + // Java is NOT in CAPITALIZE_INITIALISM_LANGUAGES + assertThat(parts.camelUnsafe).isEqualTo("userId"); + assertThat(parts.pascalUnsafe).isEqualTo("UserId"); + } + + @Test + void computeName_smartJava_httpClient() { + CasingConfiguration config = buildConfig(true, "java", null); + CasingConfiguration.NameParts parts = config.computeName("httpClient"); + + assertThat(parts.camelUnsafe).isEqualTo("httpClient"); + assertThat(parts.pascalUnsafe).isEqualTo("HttpClient"); + } + + // --- smartCasing + Python (no initialism capitalization) --- + + @Test + void computeName_smartPython_userId() { + CasingConfiguration config = buildConfig(true, "python", null); + CasingConfiguration.NameParts parts = config.computeName("userId"); + + assertThat(parts.camelUnsafe).isEqualTo("userId"); + assertThat(parts.pascalUnsafe).isEqualTo("UserId"); + } + + // --- Preprocessing --- + + @Test + void computeName_arrayBrackets() { + CasingConfiguration config = buildConfig(false, null, null); + CasingConfiguration.NameParts parts = config.computeName("Integer[]"); + + // "Integer[]" -> preprocessed to "IntegerArray" + assertThat(parts.originalName).isEqualTo("Integer[]"); + assertThat(parts.camelUnsafe).isEqualTo("integerArray"); + assertThat(parts.pascalUnsafe).isEqualTo("IntegerArray"); + assertThat(parts.snakeUnsafe).isEqualTo("integer_array"); + } + + // --- Keyword sanitization --- + + @Test + void computeName_javaKeyword_class() { + CasingConfiguration config = buildConfig(false, "java", null); + CasingConfiguration.NameParts parts = config.computeName("class"); + + assertThat(parts.camelUnsafe).isEqualTo("class"); + assertThat(parts.camelSafe).isEqualTo("class_"); + } + + @Test + void computeName_javaKeyword_return() { + CasingConfiguration config = buildConfig(false, "java", null); + CasingConfiguration.NameParts parts = config.computeName("return"); + + assertThat(parts.camelUnsafe).isEqualTo("return"); + assertThat(parts.camelSafe).isEqualTo("return_"); + } + + @Test + void computeName_javaKeyword_for() { + CasingConfiguration config = buildConfig(false, "java", null); + CasingConfiguration.NameParts parts = config.computeName("for"); + + assertThat(parts.camelUnsafe).isEqualTo("for"); + assertThat(parts.camelSafe).isEqualTo("for_"); + assertThat(parts.pascalUnsafe).isEqualTo("For"); + // "For" is not a Java keyword, so safe == unsafe + assertThat(parts.pascalSafe).isEqualTo("For"); + } + + @Test + void computeName_nonKeyword() { + CasingConfiguration config = buildConfig(false, "java", null); + CasingConfiguration.NameParts parts = config.computeName("hello"); + + assertThat(parts.camelUnsafe).isEqualTo("hello"); + assertThat(parts.camelSafe).isEqualTo("hello"); + } + + @Test + void computeName_customKeywords() { + CasingConfiguration config = buildConfig(false, null, List.of("foo", "bar")); + CasingConfiguration.NameParts parts = config.computeName("foo"); + + assertThat(parts.camelUnsafe).isEqualTo("foo"); + assertThat(parts.camelSafe).isEqualTo("foo_"); + } + + @Test + void computeName_customKeywords_overrideDefaults() { + // When keywords are provided explicitly, they override language defaults + CasingConfiguration config = buildConfig(false, "java", List.of("myKeyword")); + CasingConfiguration.NameParts parts = config.computeName("class"); + + // "class" is NOT in the custom keywords list, so it should NOT be sanitized + assertThat(parts.camelSafe).isEqualTo("class"); + } + + @Test + void computeName_startsWithNumber() { + CasingConfiguration config = buildConfig(false, "java", null); + CasingConfiguration.NameParts parts = config.computeName("2xx"); + + // "2xx" -> splitWords: ["2", "xx"] -> camelCase: "2Xx" + // Wait, let's trace: splitWords("2xx") = ["2", "xx"] + // toCamelCase: word 0 = "2" (lowercase -> "2"), word 1 = "xx" (upperFirst("xx") = "Xx") + // -> "2Xx"... but actually toCamelCase lowercases each word first + // word 0: "2".toLowerCase() = "2" + // word 1: upperFirst("xx".toLowerCase()) = "Xx" + // result: "2Xx" + // Wait, let me re-check: word 1 is "xx", toLowerCase -> "xx", upperFirst -> "Xx" + // But actually the regex: [A-Z]+(?=[A-Z][a-z])|[A-Z]?[a-z]+|[A-Z]+|[0-9]+ + // "2xx" matches [0-9]+ -> "2", then [A-Z]?[a-z]+ -> "xx" + // toCamelCase: i=0 -> "2".toLowerCase()="2", i=1 -> upperFirst("xx")="Xx" + // result: "2Xx" -> wait no, i=1 -> words.get(1).toLowerCase() then upperFirst + // "xx".toLowerCase() = "xx", upperFirst("xx") = "Xx" + // Final: "2Xx" -> Hmm that doesn't look right + // Actually checking lodash camelCase("2xx") = "2Xx" - yes that's correct + assertThat(parts.camelUnsafe).isEqualTo("2Xx"); + // starts with number -> safe adds "_" prefix + assertThat(parts.camelSafe).isEqualTo("_2Xx"); + } + + @Test + void computeName_noKeywords_noLanguage() { + // When no keywords and no language, sanitization is a no-op + CasingConfiguration config = buildConfig(false, null, null); + CasingConfiguration.NameParts parts = config.computeName("class"); + + assertThat(parts.camelUnsafe).isEqualTo("class"); + assertThat(parts.camelSafe).isEqualTo("class"); // no sanitization + } + + // --- Edge cases --- + + @Test + void computeName_singleChar() { + CasingConfiguration config = buildConfig(false, null, null); + CasingConfiguration.NameParts parts = config.computeName("a"); + + assertThat(parts.camelUnsafe).isEqualTo("a"); + assertThat(parts.pascalUnsafe).isEqualTo("A"); + assertThat(parts.snakeUnsafe).isEqualTo("a"); + assertThat(parts.screamingSnakeUnsafe).isEqualTo("A"); + } + + @Test + void computeName_originalNamePreserved() { + CasingConfiguration config = buildConfig(false, null, null); + CasingConfiguration.NameParts parts = config.computeName("MyOriginalName"); + + assertThat(parts.originalName).isEqualTo("MyOriginalName"); + } + } + + // ===== fromIrJson ===== + + @Nested + class FromIrJsonTests { + + private final ObjectMapper mapper = new ObjectMapper(); + + @Test + void fromIrJson_withCasingsConfig() { + ObjectNode root = mapper.createObjectNode(); + ObjectNode casingsConfig = mapper.createObjectNode(); + casingsConfig.put("smartCasing", true); + casingsConfig.put("generationLanguage", "go"); + casingsConfig.putArray("keywords").add("type").add("func"); + root.set("casingsConfig", casingsConfig); + + CasingConfiguration config = CasingConfiguration.fromIrJson(root); + CasingConfiguration.NameParts parts = config.computeName("userId"); + + // Go + smartCasing -> initialism capitalization + assertThat(parts.camelUnsafe).isEqualTo("userID"); + assertThat(parts.pascalUnsafe).isEqualTo("UserID"); + } + + @Test + void fromIrJson_withSmartCasingFalse() { + ObjectNode root = mapper.createObjectNode(); + ObjectNode casingsConfig = mapper.createObjectNode(); + casingsConfig.put("smartCasing", false); + root.set("casingsConfig", casingsConfig); + + CasingConfiguration config = CasingConfiguration.fromIrJson(root); + CasingConfiguration.NameParts parts = config.computeName("v2"); + + // smartCasing false -> basic snake_case -> "v_2" + assertThat(parts.snakeUnsafe).isEqualTo("v_2"); + } + + @Test + void fromIrJson_noCasingsConfig() { + ObjectNode root = mapper.createObjectNode(); + + CasingConfiguration config = CasingConfiguration.fromIrJson(root); + CasingConfiguration.NameParts parts = config.computeName("v2"); + + // Default smartCasing=true -> smart snake_case -> "v2" + assertThat(parts.snakeUnsafe).isEqualTo("v2"); + } + + @Test + void fromIrJson_nullCasingsConfig() { + ObjectNode root = mapper.createObjectNode(); + root.putNull("casingsConfig"); + + CasingConfiguration config = CasingConfiguration.fromIrJson(root); + CasingConfiguration.NameParts parts = config.computeName("v2"); + + // Default smartCasing=true + assertThat(parts.snakeUnsafe).isEqualTo("v2"); + } + + @Test + void fromIrJson_withKeywords() { + ObjectNode root = mapper.createObjectNode(); + ObjectNode casingsConfig = mapper.createObjectNode(); + casingsConfig.put("smartCasing", false); + casingsConfig.putArray("keywords").add("reserved"); + root.set("casingsConfig", casingsConfig); + + CasingConfiguration config = CasingConfiguration.fromIrJson(root); + CasingConfiguration.NameParts parts = config.computeName("reserved"); + + assertThat(parts.camelUnsafe).isEqualTo("reserved"); + assertThat(parts.camelSafe).isEqualTo("reserved_"); + } + + @Test + void fromIrJson_withJavaLanguage() { + ObjectNode root = mapper.createObjectNode(); + ObjectNode casingsConfig = mapper.createObjectNode(); + casingsConfig.put("smartCasing", true); + casingsConfig.put("generationLanguage", "java"); + root.set("casingsConfig", casingsConfig); + + CasingConfiguration config = CasingConfiguration.fromIrJson(root); + CasingConfiguration.NameParts parts = config.computeName("userId"); + + // Java is not in CAPITALIZE_INITIALISM_LANGUAGES -> no initialism + assertThat(parts.camelUnsafe).isEqualTo("userId"); + assertThat(parts.pascalUnsafe).isEqualTo("UserId"); + } + } + + // ===== Cross-check with TypeScript CasingsGenerator behavior ===== + + @Nested + class TypeScriptParityTests { + + @Test + void parity_normalName_noSmartCasing() { + // Matches TypeScript test: "normalName" with smartCasing=false + CasingConfiguration config = buildConfig(false, null, null); + CasingConfiguration.NameParts parts = config.computeName("normalName"); + + assertThat(parts.camelUnsafe).isEqualTo("normalName"); + assertThat(parts.snakeUnsafe).isEqualTo("normal_name"); + assertThat(parts.pascalUnsafe).isEqualTo("NormalName"); + } + + @ParameterizedTest + @CsvSource({ + "hello,hello,Hello,hello,HELLO", + "helloWorld,helloWorld,HelloWorld,hello_world,HELLO_WORLD", + "HelloWorld,helloWorld,HelloWorld,hello_world,HELLO_WORLD", + "HELLO_WORLD,helloWorld,HelloWorld,hello_world,HELLO_WORLD", + }) + void parity_backwardCompatibility_noSmartCasing( + String input, String camel, String pascal, String snake, String screaming) { + CasingConfiguration config = buildConfig(false, null, null); + CasingConfiguration.NameParts parts = config.computeName(input); + + assertThat(parts.camelUnsafe).isEqualTo(camel); + assertThat(parts.pascalUnsafe).isEqualTo(pascal); + assertThat(parts.snakeUnsafe).isEqualTo(snake); + assertThat(parts.screamingSnakeUnsafe).isEqualTo(screaming); + } + + @ParameterizedTest + @CsvSource({ + "v2,v2,V2", + "ec2,ec2,EC2", + "applicationV1,application_v1,APPLICATION_V1", + }) + void parity_smartCasing_snakeCase(String input, String snake, String screaming) { + CasingConfiguration config = buildConfig(true, null, null); + CasingConfiguration.NameParts parts = config.computeName(input); + + assertThat(parts.snakeUnsafe).isEqualTo(snake); + assertThat(parts.screamingSnakeUnsafe).isEqualTo(screaming); + } + + @Test + void parity_smartCasing_go_getHttpResponse() { + // Matches TypeScript test: "_getHttpResponse" with Go+smartCasing + // (we omit the underscore since Java CasingConfiguration doesn't do preserveUnderscores) + CasingConfiguration config = buildConfig(true, "go", null); + CasingConfiguration.NameParts parts = config.computeName("getHttpResponse"); + + assertThat(parts.camelUnsafe).isEqualTo("getHTTPResponse"); + } + } + + // ===== Helper to construct CasingConfiguration via fromIrJson ===== + + private static CasingConfiguration buildConfig(boolean smartCasing, String language, List keywords) { + ObjectMapper mapper = new ObjectMapper(); + ObjectNode root = mapper.createObjectNode(); + ObjectNode casingsConfig = mapper.createObjectNode(); + casingsConfig.put("smartCasing", smartCasing); + if (language != null) { + casingsConfig.put("generationLanguage", language); + } + if (keywords != null) { + var arr = casingsConfig.putArray("keywords"); + for (String kw : keywords) { + arr.add(kw); + } + } + root.set("casingsConfig", casingsConfig); + return CasingConfiguration.fromIrJson(root); + } +} diff --git a/generators/java/model/versions.yml b/generators/java/model/versions.yml index 7ea379d26710..393865daf5c0 100644 --- a/generators/java/model/versions.yml +++ b/generators/java/model/versions.yml @@ -1,4 +1,12 @@ # yaml-language-server: $schema=../../../fern-versions-yml.schema.json +- version: 1.9.0-rc.0 + changelogEntry: + - summary: | + Upgrade to IR v66 which compresses the IR Name type, reducing IR size and increasing performance. + type: feat + createdAt: "2026-04-01" + irVersion: 66 + - changelogEntry: - summary: | Fix floating-point serialization of integer-valued doubles. Values like diff --git a/generators/java/sdk/versions.yml b/generators/java/sdk/versions.yml index e6b5283682f7..a13d9aaabdc5 100644 --- a/generators/java/sdk/versions.yml +++ b/generators/java/sdk/versions.yml @@ -1,4 +1,24 @@ # yaml-language-server: $schema=../../../fern-versions-yml.schema.json +- version: 4.2.0-rc.0 + changelogEntry: + - summary: | + Upgrade to IR v66 which compresses the IR Name type, reducing IR size and increasing performance. + type: feat + createdAt: "2026-04-01" + irVersion: 66 + +- version: 4.1.3 + changelogEntry: + - summary: | + Fix undiscriminated union variant matching in dynamic snippets selecting + incorrect variants when errors are added during conversion. The matcher + now checks whether errors were added (via `errors.size() > errorsBefore`) + alongside the existing `isNop` check, preventing empty objects from being + returned for union fields like `options` in generated code snippets. + type: fix + createdAt: "2026-04-09" + irVersion: 65 + - version: 4.1.2 changelogEntry: - summary: | diff --git a/generators/python/sdk/versions.yml b/generators/python/sdk/versions.yml index 12d214b1a17d..302694fd053a 100644 --- a/generators/python/sdk/versions.yml +++ b/generators/python/sdk/versions.yml @@ -1,5 +1,21 @@ # yaml-language-server: $schema=../../../fern-versions-yml.schema.json # For unreleased changes, use unreleased.yml +- version: 5.3.8 + changelogEntry: + - summary: | + Bump generator-cli to 0.9.4. + type: chore + createdAt: "2026-04-09" + irVersion: 65 + +- version: 5.3.7 + changelogEntry: + - summary: | + Upgrade @fern-api/generator-cli to 0.9.4 which upgrades @fern-api/replay to 0.10.1. + type: chore + createdAt: "2026-04-09" + irVersion: 65 + - version: 5.3.6 changelogEntry: - summary: | diff --git a/generators/typescript-v2/dynamic-snippets/src/context/DynamicTypeLiteralMapper.ts b/generators/typescript-v2/dynamic-snippets/src/context/DynamicTypeLiteralMapper.ts index fe13a131dcce..87cc45843c09 100644 --- a/generators/typescript-v2/dynamic-snippets/src/context/DynamicTypeLiteralMapper.ts +++ b/generators/typescript-v2/dynamic-snippets/src/context/DynamicTypeLiteralMapper.ts @@ -566,7 +566,7 @@ export class DynamicTypeLiteralMapper { const errorsBefore = this.context.errors.size(); try { const result = this.convert({ typeReference, value, convertOpts }); - if (ts.TypeLiteral.isNop(result)) { + if (ts.TypeLiteral.isNop(result) || this.context.errors.size() > errorsBefore) { this.context.errors.truncate(errorsBefore); continue; } diff --git a/generators/typescript/sdk/versions.yml b/generators/typescript/sdk/versions.yml index 59c161b1e7cf..a634fe1a4fec 100644 --- a/generators/typescript/sdk/versions.yml +++ b/generators/typescript/sdk/versions.yml @@ -1,4 +1,16 @@ # yaml-language-server: $schema=../../../fern-versions-yml.schema.json +- version: 3.63.3 + changelogEntry: + - summary: | + Fix undiscriminated union variant matching in dynamic snippets selecting + incorrect variants when errors are added during conversion. The matcher + now checks whether errors were added (via `errors.size() > errorsBefore`) + alongside the existing `isNop` check, preventing empty objects from being + returned for union fields like `options` in generated code snippets. + type: fix + createdAt: "2026-04-09" + irVersion: 66 + - version: 3.63.2 changelogEntry: - summary: | diff --git a/packages/cli/cli/versions.yml b/packages/cli/cli/versions.yml index aab957147025..6c15efd09822 100644 --- a/packages/cli/cli/versions.yml +++ b/packages/cli/cli/versions.yml @@ -1,5 +1,15 @@ # yaml-language-server: $schema=../../../fern-versions-yml.schema.json +- version: 4.65.1 + changelogEntry: + - summary: | + Fixed a performance issue in `fern check` where `valid-markdown-links` + repeatedly reprocessed duplicate API descriptions and pathnames in API + sections, significantly improving runtime on large docs sites. + type: fix + createdAt: "2026-04-09" + irVersion: 66 + - version: 4.65.0 changelogEntry: - summary: | diff --git a/packages/cli/generation/ir-migrations/src/migrations/v66-to-v65/migrateFromV66ToV65.ts b/packages/cli/generation/ir-migrations/src/migrations/v66-to-v65/migrateFromV66ToV65.ts index 09b593a326e9..7c1e20cdfc2c 100644 --- a/packages/cli/generation/ir-migrations/src/migrations/v66-to-v65/migrateFromV66ToV65.ts +++ b/packages/cli/generation/ir-migrations/src/migrations/v66-to-v65/migrateFromV66ToV65.ts @@ -19,9 +19,9 @@ export const V66_TO_V65_MIGRATION: IrMigration< [GeneratorName.TYPESCRIPT]: "3.61.0-rc.0", [GeneratorName.TYPESCRIPT_SDK]: "3.61.0-rc.0", [GeneratorName.TYPESCRIPT_EXPRESS]: "0.20.0-rc.0", - [GeneratorName.JAVA]: GeneratorWasNeverUpdatedToConsumeNewIR, - [GeneratorName.JAVA_MODEL]: GeneratorWasNeverUpdatedToConsumeNewIR, - [GeneratorName.JAVA_SDK]: GeneratorWasNeverUpdatedToConsumeNewIR, + [GeneratorName.JAVA]: "4.2.0-rc.0", + [GeneratorName.JAVA_MODEL]: "1.9.0-rc.0", + [GeneratorName.JAVA_SDK]: "4.2.0-rc.0", [GeneratorName.JAVA_SPRING]: GeneratorWasNeverUpdatedToConsumeNewIR, [GeneratorName.OPENAPI_PYTHON_CLIENT]: GeneratorWasNeverUpdatedToConsumeNewIR, [GeneratorName.OPENAPI]: "0.4.0-rc.0", diff --git a/packages/cli/yaml/docs-validator/src/docsAst/visitDocsConfigFileYamlAst.ts b/packages/cli/yaml/docs-validator/src/docsAst/visitDocsConfigFileYamlAst.ts index 23443f0c8796..46b8e4d0e299 100644 --- a/packages/cli/yaml/docs-validator/src/docsAst/visitDocsConfigFileYamlAst.ts +++ b/packages/cli/yaml/docs-validator/src/docsAst/visitDocsConfigFileYamlAst.ts @@ -227,6 +227,8 @@ export async function visitDocsConfigFileYamlAst({ return; } + const navStart = performance.now(); + context.logger.debug("[docs-ast] Starting main navigation traversal..."); await visitNavigationAst({ absolutePathToFernFolder, navigation, @@ -236,12 +238,17 @@ export async function visitDocsConfigFileYamlAst({ apiWorkspaces, context }); + context.logger.debug( + `[docs-ast] Main navigation traversal complete in ${(performance.now() - navStart).toFixed(0)}ms` + ); }, products: async (products) => { if (products == null) { return; } + const productsStart = performance.now(); + context.logger.debug(`[docs-ast] Processing ${products.length} products...`); await Promise.all( products.map(async (product, idx) => { if ("path" in product) { @@ -278,6 +285,9 @@ export async function visitDocsConfigFileYamlAst({ } }) ); + context.logger.debug( + `[docs-ast] Products processing complete in ${(performance.now() - productsStart).toFixed(0)}ms` + ); }, check: noop, redirects: noop, @@ -328,6 +338,8 @@ export async function visitDocsConfigFileYamlAst({ return; } + const versionsStart = performance.now(); + context.logger.debug(`[docs-ast] Processing ${versions.length} versions...`); await Promise.all( versions.map(async (version, idx) => { await visitFilepath({ @@ -362,6 +374,9 @@ export async function visitDocsConfigFileYamlAst({ } }) ); + context.logger.debug( + `[docs-ast] Versions processing complete in ${(performance.now() - versionsStart).toFixed(0)}ms` + ); }, roles: noop, languages: noop, diff --git a/packages/cli/yaml/docs-validator/src/rules/valid-markdown-link/valid-markdown-link.ts b/packages/cli/yaml/docs-validator/src/rules/valid-markdown-link/valid-markdown-link.ts index ed986d0234aa..1e454454adf2 100644 --- a/packages/cli/yaml/docs-validator/src/rules/valid-markdown-link/valid-markdown-link.ts +++ b/packages/cli/yaml/docs-validator/src/rules/valid-markdown-link/valid-markdown-link.ts @@ -170,56 +170,59 @@ export const ValidMarkdownLinks: Rule = { convertIrToApiDefinition({ ir, apiDefinitionId: randomUUID(), context: NOOP_CONTEXT }) ); + const uniqueDescriptions = collectUniqueDescriptions(api); const violations: RuleViolation[] = []; - - for (const endpoint of endpoints) { - const descriptions = await collectDescriptions(ApiDefinition.prune(api, endpoint)); - - for (const description of descriptions) { - const { pathnamesToCheck, violations: descriptionViolations } = collectPathnamesToCheck( - description, - { instanceUrls } - ); - - violations.push(...descriptionViolations); - - const pathToCheckViolations = await Promise.all( - pathnamesToCheck.map(async (pathnameToCheck) => { - // TODO: we don't know where the endpoint is defined (which file it's in) so this doesn't always work - const exists = await checkIfPathnameExists({ - pathname: pathnameToCheck.pathname, - markdown: pathnameToCheck.markdown, - workspaceAbsoluteFilePath: workspace.absoluteFilePath, - pageSlugs: visitableSlugs, - absoluteFilePathsToSlugs, - redirects: workspace.config.redirects, - baseUrl - }); - - if (exists === true) { - return []; - } - - return exists.map((brokenPathname) => { - const [message, relFilePath] = createLinkViolationMessage({ - pathnameToCheck, - targetPathname: brokenPathname, - absoluteFilepathToWorkspace: workspace.absoluteFilePath - }); - return { - name: ValidMarkdownLinks.name, - severity: "error" as const, - message, - relFilepath: relFilePath - }; - }); - }) - ); - - violations.push(...pathToCheckViolations.flat()); + const uniquePathnames = new Map(); + + // Parse all unique descriptions to find link pathnames, then deduplicate pathnames + for (const description of uniqueDescriptions) { + const { pathnamesToCheck, violations: descriptionViolations } = collectPathnamesToCheck( + description, + { instanceUrls } + ); + violations.push(...descriptionViolations); + for (const p of pathnamesToCheck) { + if (!uniquePathnames.has(p.pathname)) { + uniquePathnames.set(p.pathname, p); + } } } + // Batch-check all unique pathnames + const pathToCheckViolations = await Promise.all( + [...uniquePathnames.values()].map(async (pathnameToCheck) => { + const exists = await checkIfPathnameExists({ + pathname: pathnameToCheck.pathname, + markdown: pathnameToCheck.markdown, + workspaceAbsoluteFilePath: workspace.absoluteFilePath, + pageSlugs: visitableSlugs, + absoluteFilePathsToSlugs, + redirects: workspace.config.redirects, + baseUrl + }); + + if (exists === true) { + return []; + } + + return exists.map((brokenPathname) => { + const [message, relFilePath] = createLinkViolationMessage({ + pathnameToCheck, + targetPathname: brokenPathname, + absoluteFilepathToWorkspace: workspace.absoluteFilePath + }); + return { + name: ValidMarkdownLinks.name, + severity: "error" as const, + message, + relFilepath: relFilePath + }; + }); + }) + ); + + violations.push(...pathToCheckViolations.flat()); + return violations; } }; @@ -257,14 +260,11 @@ function toLatest(apiDefinition: APIV1Read.ApiDefinition) { return latest; } -async function collectDescriptions(apiDefinition: ApiDefinition.ApiDefinition): Promise { - const descriptions: string[] = []; +function collectUniqueDescriptions(apiDefinition: ApiDefinition.ApiDefinition) { + const set = new Set(); ApiDefinition.Transformer.descriptions((description) => { - if (typeof description === "string") { - descriptions.push(description); - } - + set.add(description); return description; }).apiDefinition(apiDefinition); - return descriptions; + return set; } diff --git a/packages/generator-cli/package.json b/packages/generator-cli/package.json index 7a1776fb4ce4..9d0b150e9ecd 100644 --- a/packages/generator-cli/package.json +++ b/packages/generator-cli/package.json @@ -24,7 +24,7 @@ "files": ["bin", "dist", "lib"], "dependencies": { "@fern-api/core-utils": "workspace:*", - "@fern-api/replay": "^0.9.1", + "@fern-api/replay": "^0.10.1", "@octokit/rest": "catalog:", "es-toolkit": "catalog:", "tmp-promise": "catalog:" diff --git a/packages/generator-cli/versions.yml b/packages/generator-cli/versions.yml index 67ee3c311f34..9d4b4c29d612 100644 --- a/packages/generator-cli/versions.yml +++ b/packages/generator-cli/versions.yml @@ -1,4 +1,11 @@ # yaml-language-server: $schema=../../versions-yml.schema.json +- changelogEntry: + - summary: | + Upgrade @fern-api/replay to 0.10.1. + type: chore + createdAt: "2026-04-09" + version: 0.9.4 + - changelogEntry: - summary: | Add .gitattributes with linguist-generated markers for replay lockfile. Sync .fernignore entries with fern-replay to include .fern/replay.yml and .gitattributes. diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f8c46ad9a570..cf0393fe8842 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -37,8 +37,8 @@ catalogs: specifier: 0.0.6-2ee1b7e28 version: 0.0.6-2ee1b7e28 '@fern-api/generator-cli': - specifier: 0.9.3 - version: 0.9.3 + specifier: 0.9.4 + version: 0.9.4 '@fern-api/venus-api-sdk': specifier: 0.17.3-3-gf696595 version: 0.17.3-3-gf696595 @@ -630,7 +630,7 @@ importers: version: link:packages/configs '@fern-api/generator-cli': specifier: 'catalog:' - version: 0.9.3 + version: 0.9.4 '@rolldown/binding-darwin-arm64': specifier: 'catalog:' version: 1.0.0-rc.5 @@ -696,7 +696,7 @@ importers: version: link:../../packages/commons/fs-utils '@fern-api/generator-cli': specifier: 'catalog:' - version: 0.9.3 + version: 0.9.4 '@fern-api/ir-sdk': specifier: workspace:* version: link:../../packages/ir-sdk @@ -1259,8 +1259,8 @@ importers: specifier: workspace:* version: link:../../../packages/commons/logging-execa '@fern-fern/ir-sdk': - specifier: ^65.4.0 - version: 65.7.0 + specifier: ^66.0.0 + version: 66.0.0 '@types/node': specifier: 'catalog:' version: 22.19.17 @@ -1340,8 +1340,8 @@ importers: specifier: 'catalog:' version: 0.0.1167 '@fern-fern/ir-sdk': - specifier: ^65.4.0 - version: 65.7.0 + specifier: ^66.0.0 + version: 66.0.0 '@types/lodash-es': specifier: 'catalog:' version: 4.17.12 @@ -2427,7 +2427,7 @@ importers: version: link:../../../packages/commons/fs-utils '@fern-api/generator-cli': specifier: 'catalog:' - version: 0.9.3 + version: 0.9.4 '@fern-api/logger': specifier: workspace:* version: link:../../../packages/cli/logger @@ -7795,8 +7795,8 @@ importers: specifier: workspace:* version: link:../commons/core-utils '@fern-api/replay': - specifier: ^0.9.1 - version: 0.9.1 + specifier: ^0.10.1 + version: 0.10.1 '@octokit/rest': specifier: 'catalog:' version: 22.0.1 @@ -9297,15 +9297,15 @@ packages: '@fern-api/fdr-sdk@0.145.12-b50d999d1': resolution: {integrity: sha512-qTHoosyHoHFqXM/ZcHjdiAw5tByBo1mxcfMLkId9qZ4LRSw/hJmybQEa00k7dstirNnG5DvBta6Kwq74F8NfjQ==} - '@fern-api/generator-cli@0.9.3': - resolution: {integrity: sha512-4Om5HsQG8mNF31OaqCuF+2Iut+mkTegpruTB4eAKTa6d3E0SmJmx50AEUR297THjgL3Ef7j45SSR6er+K7RkdA==} + '@fern-api/generator-cli@0.9.4': + resolution: {integrity: sha512-VBA8FVLwtX/EymumqhMNW8VIhxiaWpoOoN5ghjosCASBNBRH6uHm6NRPikDZYwNa8F+4q/sEW+AoiPVofSx54Q==} hasBin: true '@fern-api/logger@0.4.24-rc1': resolution: {integrity: sha512-yh0E2F3K3IPnJZcE4dv+u8I51iKgTgv/reinKo4K5YmYEG1iLtw5vBEYMOPkQmsYFPAKIh++OMB/6TrsahMWew==} - '@fern-api/replay@0.9.1': - resolution: {integrity: sha512-RpK1UIO8qBfRL5TbyHsfDOCTyr2DPDI2XqBUDl3YOr4Mn+4EWS8C65R/k/UkJthn2KsCa57QxSvtWAxftpwljA==} + '@fern-api/replay@0.10.1': + resolution: {integrity: sha512-WjBT2GiEnsYlybLOLE13Cy0z389+45s+zN7RAf1AcxnCmc2P/JVtPwxVUReoVlFtnAxlyb3YMGPsKdsYIN+maw==} engines: {node: '>=18'} hasBin: true @@ -9343,10 +9343,6 @@ packages: '@fern-fern/ir-sdk@62.6.0': resolution: {integrity: sha512-UVSyKnIzcnvutyQ2tyIPqzG2uh+IEo8IZ3esGeULJdAKQ2fyCaDnFrpc/om08z6aCoEHRBuH+XYD/kmxODwm9A==} - '@fern-fern/ir-sdk@65.7.0': - resolution: {integrity: sha512-uq+hr8hvXUi6HlSG38P51jFrJu67eon8fAVzZ5DN9/Zydvdt2mLadrilRXF/ulFZUCfXtADnCoADM3PB/hfmtg==} - engines: {node: '>=18.0.0'} - '@fern-fern/ir-sdk@66.0.0': resolution: {integrity: sha512-uo1+fMnJOw5ApWVmKzb5wcLggjS4te3N8QorMClttA6DcBpgn0x1HbSl823oSyFvdqNV9U7GjmeQ+kzX1lWJUg==} engines: {node: '>=18.0.0'} @@ -16320,9 +16316,9 @@ snapshots: - encoding - typescript - '@fern-api/generator-cli@0.9.3': + '@fern-api/generator-cli@0.9.4': dependencies: - '@fern-api/replay': 0.9.1 + '@fern-api/replay': 0.10.1 '@octokit/rest': 22.0.1 es-toolkit: 1.45.1 tmp-promise: 3.0.3 @@ -16334,7 +16330,7 @@ snapshots: '@fern-api/core-utils': 0.4.24-rc1 chalk: 5.6.2 - '@fern-api/replay@0.9.1': + '@fern-api/replay@0.10.1': dependencies: minimatch: 10.2.5 node-diff3: 3.2.0 @@ -16436,8 +16432,6 @@ snapshots: transitivePeerDependencies: - encoding - '@fern-fern/ir-sdk@65.7.0': {} - '@fern-fern/ir-sdk@66.0.0': {} '@fern-fern/ir-sdk@66.0.0-alpha.1': {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 319e495159cd..d87d7cfed6ce 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -61,7 +61,7 @@ catalog: "@fern-api/docs-parsers": 0.0.65 "@fern-api/fai-sdk": 0.0.6-2ee1b7e28 "@fern-api/fdr-sdk": 1.1.13-c1ad12a2b8 - "@fern-api/generator-cli": 0.9.3 + "@fern-api/generator-cli": 0.9.4 "@fern-api/ui-core-utils": 0.129.4-b6c699ad2 "@fern-api/venus-api-sdk": 0.17.3-3-gf696595 "@fern-fern/docs-config": 0.0.80 diff --git a/seed/csharp-model/accept-header/src/SeedAccept.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/accept-header/src/SeedAccept.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/accept-header/src/SeedAccept.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/accept-header/src/SeedAccept.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/alias-extends/src/SeedAliasExtends.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/alias-extends/src/SeedAliasExtends.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/alias-extends/src/SeedAliasExtends.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/alias-extends/src/SeedAliasExtends.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/alias/src/SeedAlias.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/alias/src/SeedAlias.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/alias/src/SeedAlias.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/alias/src/SeedAlias.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/any-auth/src/SeedAnyAuth.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/any-auth/src/SeedAnyAuth.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/any-auth/src/SeedAnyAuth.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/any-auth/src/SeedAnyAuth.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/api-wide-base-path/src/SeedApiWideBasePath.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/api-wide-base-path/src/SeedApiWideBasePath.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/api-wide-base-path/src/SeedApiWideBasePath.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/api-wide-base-path/src/SeedApiWideBasePath.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/audiences/src/SeedAudiences.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/audiences/src/SeedAudiences.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/audiences/src/SeedAudiences.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/audiences/src/SeedAudiences.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/basic-auth-environment-variables/src/SeedBasicAuthEnvironmentVariables.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/basic-auth-environment-variables/src/SeedBasicAuthEnvironmentVariables.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/basic-auth-environment-variables/src/SeedBasicAuthEnvironmentVariables.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/basic-auth-environment-variables/src/SeedBasicAuthEnvironmentVariables.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/basic-auth-pw-omitted/src/SeedBasicAuthPwOmitted.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/basic-auth-pw-omitted/src/SeedBasicAuthPwOmitted.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/basic-auth-pw-omitted/src/SeedBasicAuthPwOmitted.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/basic-auth-pw-omitted/src/SeedBasicAuthPwOmitted.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/basic-auth/src/SeedBasicAuth.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/basic-auth/src/SeedBasicAuth.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/basic-auth/src/SeedBasicAuth.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/basic-auth/src/SeedBasicAuth.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/bearer-token-environment-variable/src/SeedBearerTokenEnvironmentVariable.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/bearer-token-environment-variable/src/SeedBearerTokenEnvironmentVariable.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/bearer-token-environment-variable/src/SeedBearerTokenEnvironmentVariable.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/bearer-token-environment-variable/src/SeedBearerTokenEnvironmentVariable.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/bytes-download/src/SeedBytesDownload.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/bytes-download/src/SeedBytesDownload.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/bytes-download/src/SeedBytesDownload.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/bytes-download/src/SeedBytesDownload.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/bytes-upload/src/SeedBytesUpload.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/bytes-upload/src/SeedBytesUpload.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/bytes-upload/src/SeedBytesUpload.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/bytes-upload/src/SeedBytesUpload.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/circular-references-advanced/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/circular-references-advanced/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/circular-references-advanced/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/circular-references-advanced/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/circular-references/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/circular-references/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/circular-references/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/circular-references/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/client-side-params/src/SeedClientSideParams.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/client-side-params/src/SeedClientSideParams.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/client-side-params/src/SeedClientSideParams.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/client-side-params/src/SeedClientSideParams.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/content-type/src/SeedContentTypes.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/content-type/src/SeedContentTypes.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/content-type/src/SeedContentTypes.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/content-type/src/SeedContentTypes.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/cross-package-type-names/src/SeedCrossPackageTypeNames.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/cross-package-type-names/src/SeedCrossPackageTypeNames.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/cross-package-type-names/src/SeedCrossPackageTypeNames.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/cross-package-type-names/src/SeedCrossPackageTypeNames.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/csharp-grpc-proto-exhaustive/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/csharp-grpc-proto-exhaustive/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/csharp-grpc-proto-exhaustive/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/csharp-grpc-proto-exhaustive/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/csharp-grpc-proto/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/csharp-grpc-proto/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/csharp-grpc-proto/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/csharp-grpc-proto/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/csharp-namespace-collision/src/SeedCsharpNamespaceCollision.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/csharp-namespace-collision/src/SeedCsharpNamespaceCollision.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/csharp-namespace-collision/src/SeedCsharpNamespaceCollision.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/csharp-namespace-collision/src/SeedCsharpNamespaceCollision.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/csharp-namespace-conflict/src/SeedCsharpNamespaceConflict.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/csharp-namespace-conflict/src/SeedCsharpNamespaceConflict.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/csharp-namespace-conflict/src/SeedCsharpNamespaceConflict.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/csharp-namespace-conflict/src/SeedCsharpNamespaceConflict.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/csharp-readonly-request/src/SeedCsharpReadonlyRequest.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/csharp-readonly-request/src/SeedCsharpReadonlyRequest.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/csharp-readonly-request/src/SeedCsharpReadonlyRequest.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/csharp-readonly-request/src/SeedCsharpReadonlyRequest.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/csharp-system-collision/src/SeedCsharpSystemCollision.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/csharp-system-collision/src/SeedCsharpSystemCollision.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/csharp-system-collision/src/SeedCsharpSystemCollision.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/csharp-system-collision/src/SeedCsharpSystemCollision.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/csharp-xml-entities/src/SeedCsharpXmlEntities.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/csharp-xml-entities/src/SeedCsharpXmlEntities.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/csharp-xml-entities/src/SeedCsharpXmlEntities.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/csharp-xml-entities/src/SeedCsharpXmlEntities.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/dollar-string-examples/src/SeedDollarStringExamples.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/dollar-string-examples/src/SeedDollarStringExamples.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/dollar-string-examples/src/SeedDollarStringExamples.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/dollar-string-examples/src/SeedDollarStringExamples.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/empty-clients/src/SeedEmptyClients.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/empty-clients/src/SeedEmptyClients.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/empty-clients/src/SeedEmptyClients.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/empty-clients/src/SeedEmptyClients.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/endpoint-security-auth/src/SeedEndpointSecurityAuth.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/endpoint-security-auth/src/SeedEndpointSecurityAuth.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/endpoint-security-auth/src/SeedEndpointSecurityAuth.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/endpoint-security-auth/src/SeedEndpointSecurityAuth.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/enum/forward-compatible-enums/src/SeedEnum.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/enum/forward-compatible-enums/src/SeedEnum.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/enum/forward-compatible-enums/src/SeedEnum.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/enum/forward-compatible-enums/src/SeedEnum.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/enum/plain-enums/src/SeedEnum.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/enum/plain-enums/src/SeedEnum.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/enum/plain-enums/src/SeedEnum.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/enum/plain-enums/src/SeedEnum.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/error-property/src/SeedErrorProperty.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/error-property/src/SeedErrorProperty.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/error-property/src/SeedErrorProperty.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/error-property/src/SeedErrorProperty.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/errors/src/SeedErrors.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/errors/src/SeedErrors.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/errors/src/SeedErrors.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/errors/src/SeedErrors.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/examples/src/SeedExamples.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/examples/src/SeedExamples.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/examples/src/SeedExamples.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/examples/src/SeedExamples.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/exhaustive/src/SeedExhaustive.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/exhaustive/src/SeedExhaustive.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/exhaustive/src/SeedExhaustive.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/exhaustive/src/SeedExhaustive.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/extends/src/SeedExtends.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/extends/src/SeedExtends.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/extends/src/SeedExtends.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/extends/src/SeedExtends.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/extra-properties/src/SeedExtraProperties.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/extra-properties/src/SeedExtraProperties.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/extra-properties/src/SeedExtraProperties.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/extra-properties/src/SeedExtraProperties.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/file-download/src/SeedFileDownload.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/file-download/src/SeedFileDownload.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/file-download/src/SeedFileDownload.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/file-download/src/SeedFileDownload.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/file-upload-openapi/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/file-upload-openapi/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/file-upload-openapi/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/file-upload-openapi/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/file-upload/src/SeedFileUpload.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/file-upload/src/SeedFileUpload.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/file-upload/src/SeedFileUpload.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/file-upload/src/SeedFileUpload.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/folders/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/folders/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/folders/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/folders/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/header-auth-environment-variable/src/SeedHeaderTokenEnvironmentVariable.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/header-auth-environment-variable/src/SeedHeaderTokenEnvironmentVariable.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/header-auth-environment-variable/src/SeedHeaderTokenEnvironmentVariable.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/header-auth-environment-variable/src/SeedHeaderTokenEnvironmentVariable.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/header-auth/src/SeedHeaderToken.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/header-auth/src/SeedHeaderToken.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/header-auth/src/SeedHeaderToken.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/header-auth/src/SeedHeaderToken.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/http-head/src/SeedHttpHead.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/http-head/src/SeedHttpHead.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/http-head/src/SeedHttpHead.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/http-head/src/SeedHttpHead.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/idempotency-headers/src/SeedIdempotencyHeaders.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/idempotency-headers/src/SeedIdempotencyHeaders.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/idempotency-headers/src/SeedIdempotencyHeaders.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/idempotency-headers/src/SeedIdempotencyHeaders.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/imdb/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/imdb/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/imdb/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/imdb/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/inferred-auth-explicit/src/SeedInferredAuthExplicit.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/inferred-auth-explicit/src/SeedInferredAuthExplicit.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/inferred-auth-explicit/src/SeedInferredAuthExplicit.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/inferred-auth-explicit/src/SeedInferredAuthExplicit.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/inferred-auth-implicit-api-key/src/SeedInferredAuthImplicitApiKey.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/inferred-auth-implicit-api-key/src/SeedInferredAuthImplicitApiKey.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/inferred-auth-implicit-api-key/src/SeedInferredAuthImplicitApiKey.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/inferred-auth-implicit-api-key/src/SeedInferredAuthImplicitApiKey.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/inferred-auth-implicit-no-expiry/src/SeedInferredAuthImplicitNoExpiry.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/inferred-auth-implicit-no-expiry/src/SeedInferredAuthImplicitNoExpiry.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/inferred-auth-implicit-no-expiry/src/SeedInferredAuthImplicitNoExpiry.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/inferred-auth-implicit-no-expiry/src/SeedInferredAuthImplicitNoExpiry.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/inferred-auth-implicit-reference/src/SeedInferredAuthImplicit.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/inferred-auth-implicit-reference/src/SeedInferredAuthImplicit.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/inferred-auth-implicit-reference/src/SeedInferredAuthImplicit.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/inferred-auth-implicit-reference/src/SeedInferredAuthImplicit.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/inferred-auth-implicit/src/SeedInferredAuthImplicit.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/inferred-auth-implicit/src/SeedInferredAuthImplicit.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/inferred-auth-implicit/src/SeedInferredAuthImplicit.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/inferred-auth-implicit/src/SeedInferredAuthImplicit.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/license/src/SeedLicense.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/license/src/SeedLicense.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/license/src/SeedLicense.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/license/src/SeedLicense.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/literal/src/SeedLiteral.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/literal/src/SeedLiteral.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/literal/src/SeedLiteral.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/literal/src/SeedLiteral.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/literals-unions/src/SeedLiteralsUnions.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/literals-unions/src/SeedLiteralsUnions.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/literals-unions/src/SeedLiteralsUnions.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/literals-unions/src/SeedLiteralsUnions.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/mixed-case/src/SeedMixedCase.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/mixed-case/src/SeedMixedCase.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/mixed-case/src/SeedMixedCase.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/mixed-case/src/SeedMixedCase.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/mixed-file-directory/src/SeedMixedFileDirectory.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/mixed-file-directory/src/SeedMixedFileDirectory.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/mixed-file-directory/src/SeedMixedFileDirectory.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/mixed-file-directory/src/SeedMixedFileDirectory.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/multi-line-docs/src/SeedMultiLineDocs.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/multi-line-docs/src/SeedMultiLineDocs.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/multi-line-docs/src/SeedMultiLineDocs.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/multi-line-docs/src/SeedMultiLineDocs.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/multi-url-environment-no-default/src/SeedMultiUrlEnvironmentNoDefault.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/multi-url-environment-no-default/src/SeedMultiUrlEnvironmentNoDefault.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/multi-url-environment-no-default/src/SeedMultiUrlEnvironmentNoDefault.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/multi-url-environment-no-default/src/SeedMultiUrlEnvironmentNoDefault.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/multi-url-environment/src/SeedMultiUrlEnvironment.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/multi-url-environment/src/SeedMultiUrlEnvironment.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/multi-url-environment/src/SeedMultiUrlEnvironment.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/multi-url-environment/src/SeedMultiUrlEnvironment.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/multiple-request-bodies/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/multiple-request-bodies/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/multiple-request-bodies/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/multiple-request-bodies/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/no-content-response/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/no-content-response/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/no-content-response/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/no-content-response/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/no-environment/src/SeedNoEnvironment.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/no-environment/src/SeedNoEnvironment.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/no-environment/src/SeedNoEnvironment.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/no-environment/src/SeedNoEnvironment.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/no-retries/src/SeedNoRetries.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/no-retries/src/SeedNoRetries.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/no-retries/src/SeedNoRetries.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/no-retries/src/SeedNoRetries.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/null-type/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/null-type/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/null-type/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/null-type/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/nullable-allof-extends/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/nullable-allof-extends/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/nullable-allof-extends/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/nullable-allof-extends/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/nullable-optional/src/SeedNullableOptional.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/nullable-optional/src/SeedNullableOptional.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/nullable-optional/src/SeedNullableOptional.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/nullable-optional/src/SeedNullableOptional.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/nullable-request-body/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/nullable-request-body/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/nullable-request-body/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/nullable-request-body/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/nullable/src/SeedNullable.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/nullable/src/SeedNullable.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/nullable/src/SeedNullable.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/nullable/src/SeedNullable.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/oauth-client-credentials-custom/src/SeedOauthClientCredentials.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/oauth-client-credentials-custom/src/SeedOauthClientCredentials.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/oauth-client-credentials-custom/src/SeedOauthClientCredentials.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/oauth-client-credentials-custom/src/SeedOauthClientCredentials.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/oauth-client-credentials-default/src/SeedOauthClientCredentialsDefault.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/oauth-client-credentials-default/src/SeedOauthClientCredentialsDefault.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/oauth-client-credentials-default/src/SeedOauthClientCredentialsDefault.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/oauth-client-credentials-default/src/SeedOauthClientCredentialsDefault.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/oauth-client-credentials-environment-variables/src/SeedOauthClientCredentialsEnvironmentVariables.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/oauth-client-credentials-environment-variables/src/SeedOauthClientCredentialsEnvironmentVariables.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/oauth-client-credentials-environment-variables/src/SeedOauthClientCredentialsEnvironmentVariables.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/oauth-client-credentials-environment-variables/src/SeedOauthClientCredentialsEnvironmentVariables.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/oauth-client-credentials-mandatory-auth/src/SeedOauthClientCredentialsMandatoryAuth.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/oauth-client-credentials-mandatory-auth/src/SeedOauthClientCredentialsMandatoryAuth.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/oauth-client-credentials-mandatory-auth/src/SeedOauthClientCredentialsMandatoryAuth.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/oauth-client-credentials-mandatory-auth/src/SeedOauthClientCredentialsMandatoryAuth.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/oauth-client-credentials-nested-root/src/SeedOauthClientCredentials.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/oauth-client-credentials-nested-root/src/SeedOauthClientCredentials.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/oauth-client-credentials-nested-root/src/SeedOauthClientCredentials.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/oauth-client-credentials-nested-root/src/SeedOauthClientCredentials.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/oauth-client-credentials-openapi/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/oauth-client-credentials-openapi/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/oauth-client-credentials-openapi/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/oauth-client-credentials-openapi/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/oauth-client-credentials-reference/src/SeedOauthClientCredentialsReference.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/oauth-client-credentials-reference/src/SeedOauthClientCredentialsReference.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/oauth-client-credentials-reference/src/SeedOauthClientCredentialsReference.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/oauth-client-credentials-reference/src/SeedOauthClientCredentialsReference.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/oauth-client-credentials-with-variables/src/SeedOauthClientCredentialsWithVariables.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/oauth-client-credentials-with-variables/src/SeedOauthClientCredentialsWithVariables.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/oauth-client-credentials-with-variables/src/SeedOauthClientCredentialsWithVariables.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/oauth-client-credentials-with-variables/src/SeedOauthClientCredentialsWithVariables.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/oauth-client-credentials/src/SeedOauthClientCredentials.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/oauth-client-credentials/src/SeedOauthClientCredentials.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/oauth-client-credentials/src/SeedOauthClientCredentials.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/oauth-client-credentials/src/SeedOauthClientCredentials.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/object/src/SeedObject.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/object/src/SeedObject.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/object/src/SeedObject.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/object/src/SeedObject.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/objects-with-imports/src/SeedObjectsWithImports.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/objects-with-imports/src/SeedObjectsWithImports.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/objects-with-imports/src/SeedObjectsWithImports.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/objects-with-imports/src/SeedObjectsWithImports.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/optional/src/SeedObjectsWithImports.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/optional/src/SeedObjectsWithImports.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/optional/src/SeedObjectsWithImports.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/optional/src/SeedObjectsWithImports.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/package-yml/src/SeedPackageYml.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/package-yml/src/SeedPackageYml.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/package-yml/src/SeedPackageYml.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/package-yml/src/SeedPackageYml.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/pagination-custom/src/SeedPagination.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/pagination-custom/src/SeedPagination.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/pagination-custom/src/SeedPagination.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/pagination-custom/src/SeedPagination.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/pagination-uri-path/src/SeedPaginationUriPath.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/pagination-uri-path/src/SeedPaginationUriPath.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/pagination-uri-path/src/SeedPaginationUriPath.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/pagination-uri-path/src/SeedPaginationUriPath.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/pagination/src/SeedPagination.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/pagination/src/SeedPagination.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/pagination/src/SeedPagination.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/pagination/src/SeedPagination.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/path-parameters/src/SeedPathParameters.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/path-parameters/src/SeedPathParameters.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/path-parameters/src/SeedPathParameters.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/path-parameters/src/SeedPathParameters.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/plain-text/src/SeedPlainText.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/plain-text/src/SeedPlainText.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/plain-text/src/SeedPlainText.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/plain-text/src/SeedPlainText.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/property-access/src/SeedPropertyAccess.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/property-access/src/SeedPropertyAccess.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/property-access/src/SeedPropertyAccess.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/property-access/src/SeedPropertyAccess.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/public-object/src/SeedPublicObject.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/public-object/src/SeedPublicObject.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/public-object/src/SeedPublicObject.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/public-object/src/SeedPublicObject.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/query-param-name-conflict/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/query-param-name-conflict/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/query-param-name-conflict/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/query-param-name-conflict/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/query-parameters-openapi-as-objects/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/query-parameters-openapi-as-objects/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/query-parameters-openapi-as-objects/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/query-parameters-openapi-as-objects/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/query-parameters-openapi/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/query-parameters-openapi/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/query-parameters-openapi/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/query-parameters-openapi/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/query-parameters/src/SeedQueryParameters.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/query-parameters/src/SeedQueryParameters.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/query-parameters/src/SeedQueryParameters.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/query-parameters/src/SeedQueryParameters.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/request-parameters/src/SeedRequestParameters.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/request-parameters/src/SeedRequestParameters.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/request-parameters/src/SeedRequestParameters.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/request-parameters/src/SeedRequestParameters.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/required-nullable/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/required-nullable/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/required-nullable/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/required-nullable/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/reserved-keywords/src/SeedNurseryApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/reserved-keywords/src/SeedNurseryApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/reserved-keywords/src/SeedNurseryApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/reserved-keywords/src/SeedNurseryApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/response-property/src/SeedResponseProperty.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/response-property/src/SeedResponseProperty.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/response-property/src/SeedResponseProperty.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/response-property/src/SeedResponseProperty.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/schemaless-request-body-examples/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/schemaless-request-body-examples/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/schemaless-request-body-examples/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/schemaless-request-body-examples/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/server-sent-event-examples/src/SeedServerSentEvents.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/server-sent-event-examples/src/SeedServerSentEvents.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/server-sent-event-examples/src/SeedServerSentEvents.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/server-sent-event-examples/src/SeedServerSentEvents.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/server-sent-events-openapi/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/server-sent-events-openapi/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/server-sent-events-openapi/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/server-sent-events-openapi/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/server-sent-events/src/SeedServerSentEvents.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/server-sent-events/src/SeedServerSentEvents.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/server-sent-events/src/SeedServerSentEvents.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/server-sent-events/src/SeedServerSentEvents.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/server-url-templating/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/server-url-templating/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/server-url-templating/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/server-url-templating/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/simple-api/src/SeedSimpleApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/simple-api/src/SeedSimpleApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/simple-api/src/SeedSimpleApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/simple-api/src/SeedSimpleApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/simple-fhir/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/simple-fhir/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/simple-fhir/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/simple-fhir/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/single-url-environment-default/src/SeedSingleUrlEnvironmentDefault.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/single-url-environment-default/src/SeedSingleUrlEnvironmentDefault.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/single-url-environment-default/src/SeedSingleUrlEnvironmentDefault.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/single-url-environment-default/src/SeedSingleUrlEnvironmentDefault.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/single-url-environment-no-default/src/SeedSingleUrlEnvironmentNoDefault.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/single-url-environment-no-default/src/SeedSingleUrlEnvironmentNoDefault.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/single-url-environment-no-default/src/SeedSingleUrlEnvironmentNoDefault.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/single-url-environment-no-default/src/SeedSingleUrlEnvironmentNoDefault.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/streaming-parameter/src/SeedStreaming.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/streaming-parameter/src/SeedStreaming.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/streaming-parameter/src/SeedStreaming.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/streaming-parameter/src/SeedStreaming.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/streaming/src/SeedStreaming.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/streaming/src/SeedStreaming.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/streaming/src/SeedStreaming.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/streaming/src/SeedStreaming.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/trace/src/SeedTrace.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/trace/src/SeedTrace.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/trace/src/SeedTrace.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/trace/src/SeedTrace.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/undiscriminated-union-with-response-property/src/SeedUndiscriminatedUnionWithResponseProperty.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/undiscriminated-union-with-response-property/src/SeedUndiscriminatedUnionWithResponseProperty.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/undiscriminated-union-with-response-property/src/SeedUndiscriminatedUnionWithResponseProperty.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/undiscriminated-union-with-response-property/src/SeedUndiscriminatedUnionWithResponseProperty.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/undiscriminated-unions/src/SeedUndiscriminatedUnions.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/undiscriminated-unions/src/SeedUndiscriminatedUnions.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/undiscriminated-unions/src/SeedUndiscriminatedUnions.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/undiscriminated-unions/src/SeedUndiscriminatedUnions.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/unions-with-local-date/src/SeedUnions.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/unions-with-local-date/src/SeedUnions.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/unions-with-local-date/src/SeedUnions.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/unions-with-local-date/src/SeedUnions.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/unions/src/SeedUnions.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/unions/src/SeedUnions.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/unions/src/SeedUnions.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/unions/src/SeedUnions.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/unknown/src/SeedUnknownAsAny.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/unknown/src/SeedUnknownAsAny.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/unknown/src/SeedUnknownAsAny.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/unknown/src/SeedUnknownAsAny.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/url-form-encoded/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/url-form-encoded/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/url-form-encoded/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/url-form-encoded/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/validation/src/SeedValidation.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/validation/src/SeedValidation.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/validation/src/SeedValidation.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/validation/src/SeedValidation.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/variables/src/SeedVariables.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/variables/src/SeedVariables.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/variables/src/SeedVariables.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/variables/src/SeedVariables.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/version-no-default/src/SeedVersion.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/version-no-default/src/SeedVersion.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/version-no-default/src/SeedVersion.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/version-no-default/src/SeedVersion.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/version/src/SeedVersion.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/version/src/SeedVersion.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/version/src/SeedVersion.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/version/src/SeedVersion.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/webhook-audience/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/webhook-audience/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/webhook-audience/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/webhook-audience/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/webhooks/src/SeedWebhooks.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/webhooks/src/SeedWebhooks.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/webhooks/src/SeedWebhooks.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/webhooks/src/SeedWebhooks.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/websocket-bearer-auth/src/SeedWebsocketBearerAuth.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/websocket-bearer-auth/src/SeedWebsocketBearerAuth.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/websocket-bearer-auth/src/SeedWebsocketBearerAuth.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/websocket-bearer-auth/src/SeedWebsocketBearerAuth.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/websocket-inferred-auth/src/SeedWebsocketAuth.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/websocket-inferred-auth/src/SeedWebsocketAuth.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/websocket-inferred-auth/src/SeedWebsocketAuth.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/websocket-inferred-auth/src/SeedWebsocketAuth.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/websocket-multi-url/src/SeedWebsocketMultiUrl.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/websocket-multi-url/src/SeedWebsocketMultiUrl.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/websocket-multi-url/src/SeedWebsocketMultiUrl.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/websocket-multi-url/src/SeedWebsocketMultiUrl.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/websocket/src/SeedWebsocket.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/websocket/src/SeedWebsocket.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/websocket/src/SeedWebsocket.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/websocket/src/SeedWebsocket.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-model/x-fern-default/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/x-fern-default/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-model/x-fern-default/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-model/x-fern-default/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/accept-header/src/SeedAccept.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/accept-header/src/SeedAccept.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/accept-header/src/SeedAccept.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/accept-header/src/SeedAccept.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/alias-extends/src/SeedAliasExtends.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/alias-extends/src/SeedAliasExtends.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/alias-extends/src/SeedAliasExtends.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/alias-extends/src/SeedAliasExtends.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/alias/src/SeedAlias.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/alias/src/SeedAlias.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/alias/src/SeedAlias.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/alias/src/SeedAlias.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/any-auth/src/SeedAnyAuth.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/any-auth/src/SeedAnyAuth.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/any-auth/src/SeedAnyAuth.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/any-auth/src/SeedAnyAuth.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/api-wide-base-path/src/SeedApiWideBasePath.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/api-wide-base-path/src/SeedApiWideBasePath.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/api-wide-base-path/src/SeedApiWideBasePath.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/api-wide-base-path/src/SeedApiWideBasePath.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/audiences/src/SeedAudiences.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/audiences/src/SeedAudiences.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/audiences/src/SeedAudiences.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/audiences/src/SeedAudiences.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/basic-auth-environment-variables/src/SeedBasicAuthEnvironmentVariables.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/basic-auth-environment-variables/src/SeedBasicAuthEnvironmentVariables.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/basic-auth-environment-variables/src/SeedBasicAuthEnvironmentVariables.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/basic-auth-environment-variables/src/SeedBasicAuthEnvironmentVariables.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/basic-auth-pw-omitted/src/SeedBasicAuthPwOmitted.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/basic-auth-pw-omitted/src/SeedBasicAuthPwOmitted.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/basic-auth-pw-omitted/src/SeedBasicAuthPwOmitted.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/basic-auth-pw-omitted/src/SeedBasicAuthPwOmitted.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/basic-auth/no-custom-config/src/SeedBasicAuth.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/basic-auth/no-custom-config/src/SeedBasicAuth.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/basic-auth/no-custom-config/src/SeedBasicAuth.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/basic-auth/no-custom-config/src/SeedBasicAuth.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/basic-auth/unified-client-options/src/SeedBasicAuth.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/basic-auth/unified-client-options/src/SeedBasicAuth.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/basic-auth/unified-client-options/src/SeedBasicAuth.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/basic-auth/unified-client-options/src/SeedBasicAuth.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/basic-auth/wire-tests/src/SeedBasicAuth.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/basic-auth/wire-tests/src/SeedBasicAuth.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/basic-auth/wire-tests/src/SeedBasicAuth.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/basic-auth/wire-tests/src/SeedBasicAuth.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/bearer-token-environment-variable/no-custom-config/src/SeedBearerTokenEnvironmentVariable.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/bearer-token-environment-variable/no-custom-config/src/SeedBearerTokenEnvironmentVariable.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/bearer-token-environment-variable/no-custom-config/src/SeedBearerTokenEnvironmentVariable.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/bearer-token-environment-variable/no-custom-config/src/SeedBearerTokenEnvironmentVariable.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/bearer-token-environment-variable/unified-client-options/src/SeedBearerTokenEnvironmentVariable.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/bearer-token-environment-variable/unified-client-options/src/SeedBearerTokenEnvironmentVariable.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/bearer-token-environment-variable/unified-client-options/src/SeedBearerTokenEnvironmentVariable.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/bearer-token-environment-variable/unified-client-options/src/SeedBearerTokenEnvironmentVariable.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/bytes-download/src/SeedBytesDownload.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/bytes-download/src/SeedBytesDownload.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/bytes-download/src/SeedBytesDownload.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/bytes-download/src/SeedBytesDownload.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/bytes-upload/src/SeedBytesUpload.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/bytes-upload/src/SeedBytesUpload.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/bytes-upload/src/SeedBytesUpload.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/bytes-upload/src/SeedBytesUpload.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/circular-references-advanced/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/circular-references-advanced/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/circular-references-advanced/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/circular-references-advanced/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/circular-references/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/circular-references/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/circular-references/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/circular-references/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/client-side-params/src/SeedClientSideParams.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/client-side-params/src/SeedClientSideParams.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/client-side-params/src/SeedClientSideParams.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/client-side-params/src/SeedClientSideParams.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/cross-package-type-names/src/SeedCrossPackageTypeNames.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/cross-package-type-names/src/SeedCrossPackageTypeNames.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/cross-package-type-names/src/SeedCrossPackageTypeNames.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/cross-package-type-names/src/SeedCrossPackageTypeNames.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/include-exception-handler/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/include-exception-handler/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/include-exception-handler/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/include-exception-handler/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/no-custom-config/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/no-custom-config/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/no-custom-config/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/no-custom-config/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/package-id/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/package-id/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/package-id/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/package-id/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/read-only-memory/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/read-only-memory/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/read-only-memory/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/read-only-memory/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/csharp-grpc-proto/no-custom-config/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/csharp-grpc-proto/no-custom-config/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/csharp-grpc-proto/no-custom-config/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/csharp-grpc-proto/no-custom-config/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/csharp-namespace-collision/explicit-namespaces/src/Contoso.Net.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/csharp-namespace-collision/explicit-namespaces/src/Contoso.Net.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/csharp-namespace-collision/explicit-namespaces/src/Contoso.Net.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/csharp-namespace-collision/explicit-namespaces/src/Contoso.Net.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/csharp-namespace-collision/fully-qualified-namespaces/src/SeedCsharpNamespaceCollision.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/csharp-namespace-collision/fully-qualified-namespaces/src/SeedCsharpNamespaceCollision.Test/Utils/JsonElementComparer.cs index 783d206481b5..7cb7153fa17f 100644 --- a/seed/csharp-sdk/csharp-namespace-collision/fully-qualified-namespaces/src/SeedCsharpNamespaceCollision.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/csharp-namespace-collision/fully-qualified-namespaces/src/SeedCsharpNamespaceCollision.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/csharp-namespace-collision/namespace-client-collision/src/Contoso.Net.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/csharp-namespace-collision/namespace-client-collision/src/Contoso.Net.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/csharp-namespace-collision/namespace-client-collision/src/Contoso.Net.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/csharp-namespace-collision/namespace-client-collision/src/Contoso.Net.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/csharp-namespace-collision/no-client-namespace-match/src/Contoso.Net.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/csharp-namespace-collision/no-client-namespace-match/src/Contoso.Net.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/csharp-namespace-collision/no-client-namespace-match/src/Contoso.Net.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/csharp-namespace-collision/no-client-namespace-match/src/Contoso.Net.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/csharp-namespace-conflict/client-class-name-matches-namespace-root/src/Seed.CsharpNamespaceConflict.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/csharp-namespace-conflict/client-class-name-matches-namespace-root/src/Seed.CsharpNamespaceConflict.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/csharp-namespace-conflict/client-class-name-matches-namespace-root/src/Seed.CsharpNamespaceConflict.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/csharp-namespace-conflict/client-class-name-matches-namespace-root/src/Seed.CsharpNamespaceConflict.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/csharp-readonly-request/src/SeedCsharpReadonlyRequest.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/csharp-readonly-request/src/SeedCsharpReadonlyRequest.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/csharp-readonly-request/src/SeedCsharpReadonlyRequest.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/csharp-readonly-request/src/SeedCsharpReadonlyRequest.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/csharp-system-collision/system-client/src/SeedCsharpSystemCollision.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/csharp-system-collision/system-client/src/SeedCsharpSystemCollision.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/csharp-system-collision/system-client/src/SeedCsharpSystemCollision.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/csharp-system-collision/system-client/src/SeedCsharpSystemCollision.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/csharp-xml-entities/no-custom-config/src/SeedCsharpXmlEntities.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/csharp-xml-entities/no-custom-config/src/SeedCsharpXmlEntities.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/csharp-xml-entities/no-custom-config/src/SeedCsharpXmlEntities.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/csharp-xml-entities/no-custom-config/src/SeedCsharpXmlEntities.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/dollar-string-examples/src/SeedDollarStringExamples.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/dollar-string-examples/src/SeedDollarStringExamples.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/dollar-string-examples/src/SeedDollarStringExamples.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/dollar-string-examples/src/SeedDollarStringExamples.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/empty-clients/src/SeedEmptyClients.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/empty-clients/src/SeedEmptyClients.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/empty-clients/src/SeedEmptyClients.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/empty-clients/src/SeedEmptyClients.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/endpoint-security-auth/src/SeedEndpointSecurityAuth.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/endpoint-security-auth/src/SeedEndpointSecurityAuth.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/endpoint-security-auth/src/SeedEndpointSecurityAuth.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/endpoint-security-auth/src/SeedEndpointSecurityAuth.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/enum/forward-compatible-enums/src/SeedEnum.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/enum/forward-compatible-enums/src/SeedEnum.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/enum/forward-compatible-enums/src/SeedEnum.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/enum/forward-compatible-enums/src/SeedEnum.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/enum/plain-enums/src/SeedEnum.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/enum/plain-enums/src/SeedEnum.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/enum/plain-enums/src/SeedEnum.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/enum/plain-enums/src/SeedEnum.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/error-property/src/SeedErrorProperty.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/error-property/src/SeedErrorProperty.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/error-property/src/SeedErrorProperty.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/error-property/src/SeedErrorProperty.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/errors/src/SeedErrors.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/errors/src/SeedErrors.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/errors/src/SeedErrors.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/errors/src/SeedErrors.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/examples/no-custom-config/src/SeedExamples.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/examples/no-custom-config/src/SeedExamples.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/examples/no-custom-config/src/SeedExamples.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/examples/no-custom-config/src/SeedExamples.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/examples/readme-config/src/SeedExamples.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/examples/readme-config/src/SeedExamples.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/examples/readme-config/src/SeedExamples.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/examples/readme-config/src/SeedExamples.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/exhaustive/explicit-namespaces/src/SeedExhaustive.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/exhaustive/explicit-namespaces/src/SeedExhaustive.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/exhaustive/explicit-namespaces/src/SeedExhaustive.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/exhaustive/explicit-namespaces/src/SeedExhaustive.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/exhaustive/include-exception-handler/src/SeedExhaustive.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/exhaustive/include-exception-handler/src/SeedExhaustive.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/exhaustive/include-exception-handler/src/SeedExhaustive.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/exhaustive/include-exception-handler/src/SeedExhaustive.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/exhaustive/no-generate-error-types/src/SeedExhaustive.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/exhaustive/no-generate-error-types/src/SeedExhaustive.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/exhaustive/no-generate-error-types/src/SeedExhaustive.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/exhaustive/no-generate-error-types/src/SeedExhaustive.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/exhaustive/no-root-namespace-for-core-classes/src/SeedExhaustive.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/exhaustive/no-root-namespace-for-core-classes/src/SeedExhaustive.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/exhaustive/no-root-namespace-for-core-classes/src/SeedExhaustive.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/exhaustive/no-root-namespace-for-core-classes/src/SeedExhaustive.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/exhaustive/redact-response-body-on-error/src/SeedExhaustive.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/exhaustive/redact-response-body-on-error/src/SeedExhaustive.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/exhaustive/redact-response-body-on-error/src/SeedExhaustive.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/exhaustive/redact-response-body-on-error/src/SeedExhaustive.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/exhaustive/use-undiscriminated-unions/src/SeedExhaustive.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/exhaustive/use-undiscriminated-unions/src/SeedExhaustive.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/exhaustive/use-undiscriminated-unions/src/SeedExhaustive.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/exhaustive/use-undiscriminated-unions/src/SeedExhaustive.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/extends/src/SeedExtends.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/extends/src/SeedExtends.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/extends/src/SeedExtends.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/extends/src/SeedExtends.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/extra-properties/src/SeedExtraProperties.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/extra-properties/src/SeedExtraProperties.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/extra-properties/src/SeedExtraProperties.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/extra-properties/src/SeedExtraProperties.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/file-download/src/SeedFileDownload.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/file-download/src/SeedFileDownload.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/file-download/src/SeedFileDownload.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/file-download/src/SeedFileDownload.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/file-upload-openapi/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/file-upload-openapi/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/file-upload-openapi/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/file-upload-openapi/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/file-upload/src/SeedFileUpload.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/file-upload/src/SeedFileUpload.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/file-upload/src/SeedFileUpload.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/file-upload/src/SeedFileUpload.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/folders/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/folders/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/folders/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/folders/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/header-auth-environment-variable/src/SeedHeaderTokenEnvironmentVariable.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/header-auth-environment-variable/src/SeedHeaderTokenEnvironmentVariable.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/header-auth-environment-variable/src/SeedHeaderTokenEnvironmentVariable.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/header-auth-environment-variable/src/SeedHeaderTokenEnvironmentVariable.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/header-auth/src/SeedHeaderToken.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/header-auth/src/SeedHeaderToken.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/header-auth/src/SeedHeaderToken.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/header-auth/src/SeedHeaderToken.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/http-head/src/SeedHttpHead.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/http-head/src/SeedHttpHead.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/http-head/src/SeedHttpHead.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/http-head/src/SeedHttpHead.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/idempotency-headers/src/SeedIdempotencyHeaders.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/idempotency-headers/src/SeedIdempotencyHeaders.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/idempotency-headers/src/SeedIdempotencyHeaders.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/idempotency-headers/src/SeedIdempotencyHeaders.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/imdb/exception-class-names/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/imdb/exception-class-names/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/imdb/exception-class-names/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/imdb/exception-class-names/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/imdb/exported-client-class-name/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/imdb/exported-client-class-name/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/imdb/exported-client-class-name/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/imdb/exported-client-class-name/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/imdb/extra-dependencies-override/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/imdb/extra-dependencies-override/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/imdb/extra-dependencies-override/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/imdb/extra-dependencies-override/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/imdb/extra-dependencies/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/imdb/extra-dependencies/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/imdb/extra-dependencies/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/imdb/extra-dependencies/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/imdb/include-exception-handler/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/imdb/include-exception-handler/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/imdb/include-exception-handler/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/imdb/include-exception-handler/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/imdb/no-custom-config/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/imdb/no-custom-config/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/imdb/no-custom-config/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/imdb/no-custom-config/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/imdb/omit-fern-headers/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/imdb/omit-fern-headers/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/imdb/omit-fern-headers/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/imdb/omit-fern-headers/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/inferred-auth-explicit/src/SeedInferredAuthExplicit.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/inferred-auth-explicit/src/SeedInferredAuthExplicit.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/inferred-auth-explicit/src/SeedInferredAuthExplicit.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/inferred-auth-explicit/src/SeedInferredAuthExplicit.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/inferred-auth-implicit-api-key/src/SeedInferredAuthImplicitApiKey.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/inferred-auth-implicit-api-key/src/SeedInferredAuthImplicitApiKey.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/inferred-auth-implicit-api-key/src/SeedInferredAuthImplicitApiKey.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/inferred-auth-implicit-api-key/src/SeedInferredAuthImplicitApiKey.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/inferred-auth-implicit-no-expiry/src/SeedInferredAuthImplicitNoExpiry.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/inferred-auth-implicit-no-expiry/src/SeedInferredAuthImplicitNoExpiry.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/inferred-auth-implicit-no-expiry/src/SeedInferredAuthImplicitNoExpiry.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/inferred-auth-implicit-no-expiry/src/SeedInferredAuthImplicitNoExpiry.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/inferred-auth-implicit-reference/src/SeedInferredAuthImplicit.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/inferred-auth-implicit-reference/src/SeedInferredAuthImplicit.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/inferred-auth-implicit-reference/src/SeedInferredAuthImplicit.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/inferred-auth-implicit-reference/src/SeedInferredAuthImplicit.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/inferred-auth-implicit/src/SeedInferredAuthImplicit.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/inferred-auth-implicit/src/SeedInferredAuthImplicit.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/inferred-auth-implicit/src/SeedInferredAuthImplicit.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/inferred-auth-implicit/src/SeedInferredAuthImplicit.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/license/custom-license/src/SeedLicense.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/license/custom-license/src/SeedLicense.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/license/custom-license/src/SeedLicense.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/license/custom-license/src/SeedLicense.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/license/mit-license/src/SeedLicense.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/license/mit-license/src/SeedLicense.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/license/mit-license/src/SeedLicense.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/license/mit-license/src/SeedLicense.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/literal/no-custom-config/src/SeedLiteral.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/literal/no-custom-config/src/SeedLiteral.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/literal/no-custom-config/src/SeedLiteral.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/literal/no-custom-config/src/SeedLiteral.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/literal/readonly-constants/reference.md b/seed/csharp-sdk/literal/readonly-constants/reference.md index a80293b34ab4..e03ede34ef04 100644 --- a/seed/csharp-sdk/literal/readonly-constants/reference.md +++ b/seed/csharp-sdk/literal/readonly-constants/reference.md @@ -65,15 +65,9 @@ await client.Inlined.SendAsync( new SendLiteralsInlinedRequest { Temperature = 10.1, - Prompt = "You are a helpful assistant", Context = "You're super wise", - AliasedContext = "You're super wise", MaybeContext = "You're super wise", - ObjectWithLiteral = new ATopLevelLiteral - { - NestedLiteral = new ANestedLiteral { MyLiteral = "How super cool" }, - }, - Stream = false, + ObjectWithLiteral = new ATopLevelLiteral { NestedLiteral = new ANestedLiteral() }, Query = "What is the weather today", } ); @@ -215,20 +209,12 @@ await client.Query.SendAsync( await client.Reference.SendAsync( new SendRequest { - Prompt = "You are a helpful assistant", - Stream = false, - Context = "You're super wise", Query = "What is the weather today", ContainerObject = new ContainerObject { NestedObjects = new List() { - new NestedObjectWithLiterals - { - Literal1 = "literal1", - Literal2 = "literal2", - StrProp = "strProp", - }, + new NestedObjectWithLiterals { StrProp = "strProp" }, }, }, } diff --git a/seed/csharp-sdk/literal/readonly-constants/snippet.json b/seed/csharp-sdk/literal/readonly-constants/snippet.json index e1f093deceee..b5e771cb39f7 100644 --- a/seed/csharp-sdk/literal/readonly-constants/snippet.json +++ b/seed/csharp-sdk/literal/readonly-constants/snippet.json @@ -22,7 +22,7 @@ }, "snippet": { "type": "csharp", - "client": "using SeedLiteral;\n\nvar client = new SeedLiteralClient();\nawait client.Inlined.SendAsync(\n new SendLiteralsInlinedRequest\n {\n Temperature = 10.1,\n Prompt = \"You are a helpful assistant\",\n Context = \"You're super wise\",\n AliasedContext = \"You're super wise\",\n MaybeContext = \"You're super wise\",\n ObjectWithLiteral = new ATopLevelLiteral\n {\n NestedLiteral = new ANestedLiteral { MyLiteral = \"How super cool\" },\n },\n Stream = false,\n Query = \"What is the weather today\",\n }\n);\n" + "client": "using SeedLiteral;\n\nvar client = new SeedLiteralClient();\nawait client.Inlined.SendAsync(\n new SendLiteralsInlinedRequest\n {\n Temperature = 10.1,\n Context = \"You're super wise\",\n MaybeContext = \"You're super wise\",\n ObjectWithLiteral = new ATopLevelLiteral { NestedLiteral = new ANestedLiteral() },\n Query = \"What is the weather today\",\n }\n);\n" } }, { @@ -58,7 +58,7 @@ }, "snippet": { "type": "csharp", - "client": "using SeedLiteral;\n\nvar client = new SeedLiteralClient();\nawait client.Reference.SendAsync(\n new SendRequest\n {\n Prompt = \"You are a helpful assistant\",\n Stream = false,\n Context = \"You're super wise\",\n Query = \"What is the weather today\",\n ContainerObject = new ContainerObject\n {\n NestedObjects = new List()\n {\n new NestedObjectWithLiterals\n {\n Literal1 = \"literal1\",\n Literal2 = \"literal2\",\n StrProp = \"strProp\",\n },\n },\n },\n }\n);\n" + "client": "using SeedLiteral;\n\nvar client = new SeedLiteralClient();\nawait client.Reference.SendAsync(\n new SendRequest\n {\n Query = \"What is the weather today\",\n ContainerObject = new ContainerObject\n {\n NestedObjects = new List()\n {\n new NestedObjectWithLiterals { StrProp = \"strProp\" },\n },\n },\n }\n);\n" } } ] diff --git a/seed/csharp-sdk/literal/readonly-constants/src/SeedLiteral.Test/Unit/MockServer/Inlined/SendTest.cs b/seed/csharp-sdk/literal/readonly-constants/src/SeedLiteral.Test/Unit/MockServer/Inlined/SendTest.cs index 621745c65968..5994338465f3 100644 --- a/seed/csharp-sdk/literal/readonly-constants/src/SeedLiteral.Test/Unit/MockServer/Inlined/SendTest.cs +++ b/seed/csharp-sdk/literal/readonly-constants/src/SeedLiteral.Test/Unit/MockServer/Inlined/SendTest.cs @@ -55,17 +55,11 @@ public async Task MockServerTest_1() var response = await Client.Inlined.SendAsync( new SendLiteralsInlinedRequest { - Prompt = "You are a helpful assistant", Context = "You're super wise", Query = "query", Temperature = 1.1, - Stream = false, - AliasedContext = "You're super wise", MaybeContext = "You're super wise", - ObjectWithLiteral = new ATopLevelLiteral - { - NestedLiteral = new ANestedLiteral { MyLiteral = "How super cool" }, - }, + ObjectWithLiteral = new ATopLevelLiteral { NestedLiteral = new ANestedLiteral() }, } ); JsonAssert.AreEqual(response, mockResponse); @@ -118,15 +112,9 @@ public async Task MockServerTest_2() new SendLiteralsInlinedRequest { Temperature = 10.1, - Prompt = "You are a helpful assistant", Context = "You're super wise", - AliasedContext = "You're super wise", MaybeContext = "You're super wise", - ObjectWithLiteral = new ATopLevelLiteral - { - NestedLiteral = new ANestedLiteral { MyLiteral = "How super cool" }, - }, - Stream = false, + ObjectWithLiteral = new ATopLevelLiteral { NestedLiteral = new ANestedLiteral() }, Query = "What is the weather today", } ); diff --git a/seed/csharp-sdk/literal/readonly-constants/src/SeedLiteral.Test/Unit/MockServer/Reference/SendTest.cs b/seed/csharp-sdk/literal/readonly-constants/src/SeedLiteral.Test/Unit/MockServer/Reference/SendTest.cs index 2e4fec3bc851..c76db213b725 100644 --- a/seed/csharp-sdk/literal/readonly-constants/src/SeedLiteral.Test/Unit/MockServer/Reference/SendTest.cs +++ b/seed/csharp-sdk/literal/readonly-constants/src/SeedLiteral.Test/Unit/MockServer/Reference/SendTest.cs @@ -63,28 +63,14 @@ public async Task MockServerTest_1() var response = await Client.Reference.SendAsync( new SendRequest { - Prompt = "You are a helpful assistant", Query = "query", - Stream = false, - Ending = "$ending", - Context = "You're super wise", MaybeContext = "You're super wise", ContainerObject = new ContainerObject { NestedObjects = new List() { - new NestedObjectWithLiterals - { - Literal1 = "literal1", - Literal2 = "literal2", - StrProp = "strProp", - }, - new NestedObjectWithLiterals - { - Literal1 = "literal1", - Literal2 = "literal2", - StrProp = "strProp", - }, + new NestedObjectWithLiterals { StrProp = "strProp" }, + new NestedObjectWithLiterals { StrProp = "strProp" }, }, }, } @@ -139,20 +125,12 @@ public async Task MockServerTest_2() var response = await Client.Reference.SendAsync( new SendRequest { - Prompt = "You are a helpful assistant", - Stream = false, - Context = "You're super wise", Query = "What is the weather today", ContainerObject = new ContainerObject { NestedObjects = new List() { - new NestedObjectWithLiterals - { - Literal1 = "literal1", - Literal2 = "literal2", - StrProp = "strProp", - }, + new NestedObjectWithLiterals { StrProp = "strProp" }, }, }, } diff --git a/seed/csharp-sdk/literal/readonly-constants/src/SeedLiteral.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/literal/readonly-constants/src/SeedLiteral.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/literal/readonly-constants/src/SeedLiteral.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/literal/readonly-constants/src/SeedLiteral.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/literal/readonly-constants/src/SeedLiteral/Inlined/InlinedClient.cs b/seed/csharp-sdk/literal/readonly-constants/src/SeedLiteral/Inlined/InlinedClient.cs index 731d702bc390..738578d13e66 100644 --- a/seed/csharp-sdk/literal/readonly-constants/src/SeedLiteral/Inlined/InlinedClient.cs +++ b/seed/csharp-sdk/literal/readonly-constants/src/SeedLiteral/Inlined/InlinedClient.cs @@ -83,15 +83,9 @@ private async Task> SendAsyncCore( /// new SendLiteralsInlinedRequest /// { /// Temperature = 10.1, - /// Prompt = "You are a helpful assistant", /// Context = "You're super wise", - /// AliasedContext = "You're super wise", /// MaybeContext = "You're super wise", - /// ObjectWithLiteral = new ATopLevelLiteral - /// { - /// NestedLiteral = new ANestedLiteral { MyLiteral = "How super cool" }, - /// }, - /// Stream = false, + /// ObjectWithLiteral = new ATopLevelLiteral { NestedLiteral = new ANestedLiteral() }, /// Query = "What is the weather today", /// } /// ); diff --git a/seed/csharp-sdk/literal/readonly-constants/src/SeedLiteral/Reference/ReferenceClient.cs b/seed/csharp-sdk/literal/readonly-constants/src/SeedLiteral/Reference/ReferenceClient.cs index 5e357685f3fe..8a2e3cbebe5c 100644 --- a/seed/csharp-sdk/literal/readonly-constants/src/SeedLiteral/Reference/ReferenceClient.cs +++ b/seed/csharp-sdk/literal/readonly-constants/src/SeedLiteral/Reference/ReferenceClient.cs @@ -82,20 +82,12 @@ private async Task> SendAsyncCore( /// await client.Reference.SendAsync( /// new SendRequest /// { - /// Prompt = "You are a helpful assistant", - /// Stream = false, - /// Context = "You're super wise", /// Query = "What is the weather today", /// ContainerObject = new ContainerObject /// { /// NestedObjects = new List<NestedObjectWithLiterals>() /// { - /// new NestedObjectWithLiterals - /// { - /// Literal1 = "literal1", - /// Literal2 = "literal2", - /// StrProp = "strProp", - /// }, + /// new NestedObjectWithLiterals { StrProp = "strProp" }, /// }, /// }, /// } diff --git a/seed/csharp-sdk/literals-unions/src/SeedLiteralsUnions.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/literals-unions/src/SeedLiteralsUnions.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/literals-unions/src/SeedLiteralsUnions.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/literals-unions/src/SeedLiteralsUnions.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/mixed-case/src/SeedMixedCase.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/mixed-case/src/SeedMixedCase.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/mixed-case/src/SeedMixedCase.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/mixed-case/src/SeedMixedCase.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/mixed-file-directory/src/SeedMixedFileDirectory.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/mixed-file-directory/src/SeedMixedFileDirectory.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/mixed-file-directory/src/SeedMixedFileDirectory.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/mixed-file-directory/src/SeedMixedFileDirectory.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/multi-line-docs/src/SeedMultiLineDocs.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/multi-line-docs/src/SeedMultiLineDocs.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/multi-line-docs/src/SeedMultiLineDocs.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/multi-line-docs/src/SeedMultiLineDocs.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/multi-url-environment-no-default/src/SeedMultiUrlEnvironmentNoDefault.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/multi-url-environment-no-default/src/SeedMultiUrlEnvironmentNoDefault.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/multi-url-environment-no-default/src/SeedMultiUrlEnvironmentNoDefault.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/multi-url-environment-no-default/src/SeedMultiUrlEnvironmentNoDefault.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/multi-url-environment/environment-class-name/src/SeedMultiUrlEnvironment.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/multi-url-environment/environment-class-name/src/SeedMultiUrlEnvironment.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/multi-url-environment/environment-class-name/src/SeedMultiUrlEnvironment.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/multi-url-environment/environment-class-name/src/SeedMultiUrlEnvironment.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/multi-url-environment/no-pascal-case-environments/src/SeedMultiUrlEnvironment.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/multi-url-environment/no-pascal-case-environments/src/SeedMultiUrlEnvironment.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/multi-url-environment/no-pascal-case-environments/src/SeedMultiUrlEnvironment.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/multi-url-environment/no-pascal-case-environments/src/SeedMultiUrlEnvironment.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/multiple-request-bodies/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/multiple-request-bodies/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/multiple-request-bodies/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/multiple-request-bodies/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/no-content-response/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/no-content-response/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/no-content-response/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/no-content-response/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/no-environment/src/SeedNoEnvironment.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/no-environment/src/SeedNoEnvironment.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/no-environment/src/SeedNoEnvironment.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/no-environment/src/SeedNoEnvironment.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/no-retries/src/SeedNoRetries.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/no-retries/src/SeedNoRetries.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/no-retries/src/SeedNoRetries.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/no-retries/src/SeedNoRetries.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/null-type/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/null-type/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/null-type/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/null-type/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/nullable-allof-extends/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/nullable-allof-extends/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/nullable-allof-extends/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/nullable-allof-extends/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/nullable-optional/explicit-nullable-optional/src/SeedNullableOptional.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/nullable-optional/explicit-nullable-optional/src/SeedNullableOptional.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/nullable-optional/explicit-nullable-optional/src/SeedNullableOptional.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/nullable-optional/explicit-nullable-optional/src/SeedNullableOptional.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/nullable-optional/no-custom-config/src/SeedNullableOptional.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/nullable-optional/no-custom-config/src/SeedNullableOptional.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/nullable-optional/no-custom-config/src/SeedNullableOptional.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/nullable-optional/no-custom-config/src/SeedNullableOptional.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/nullable-request-body/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/nullable-request-body/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/nullable-request-body/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/nullable-request-body/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/nullable/explicit-nullable-optional/src/SeedNullable.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/nullable/explicit-nullable-optional/src/SeedNullable.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/nullable/explicit-nullable-optional/src/SeedNullable.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/nullable/explicit-nullable-optional/src/SeedNullable.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/nullable/no-custom-config/src/SeedNullable.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/nullable/no-custom-config/src/SeedNullable.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/nullable/no-custom-config/src/SeedNullable.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/nullable/no-custom-config/src/SeedNullable.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/oauth-client-credentials-custom/src/SeedOauthClientCredentials.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/oauth-client-credentials-custom/src/SeedOauthClientCredentials.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/oauth-client-credentials-custom/src/SeedOauthClientCredentials.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/oauth-client-credentials-custom/src/SeedOauthClientCredentials.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/oauth-client-credentials-default/src/SeedOauthClientCredentialsDefault.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/oauth-client-credentials-default/src/SeedOauthClientCredentialsDefault.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/oauth-client-credentials-default/src/SeedOauthClientCredentialsDefault.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/oauth-client-credentials-default/src/SeedOauthClientCredentialsDefault.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/oauth-client-credentials-environment-variables/src/SeedOauthClientCredentialsEnvironmentVariables.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/oauth-client-credentials-environment-variables/src/SeedOauthClientCredentialsEnvironmentVariables.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/oauth-client-credentials-environment-variables/src/SeedOauthClientCredentialsEnvironmentVariables.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/oauth-client-credentials-environment-variables/src/SeedOauthClientCredentialsEnvironmentVariables.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/oauth-client-credentials-mandatory-auth/no-custom-config/src/SeedOauthClientCredentialsMandatoryAuth.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/oauth-client-credentials-mandatory-auth/no-custom-config/src/SeedOauthClientCredentialsMandatoryAuth.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/oauth-client-credentials-mandatory-auth/no-custom-config/src/SeedOauthClientCredentialsMandatoryAuth.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/oauth-client-credentials-mandatory-auth/no-custom-config/src/SeedOauthClientCredentialsMandatoryAuth.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/oauth-client-credentials-mandatory-auth/unified-client-options/src/SeedOauthClientCredentialsMandatoryAuth.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/oauth-client-credentials-mandatory-auth/unified-client-options/src/SeedOauthClientCredentialsMandatoryAuth.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/oauth-client-credentials-mandatory-auth/unified-client-options/src/SeedOauthClientCredentialsMandatoryAuth.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/oauth-client-credentials-mandatory-auth/unified-client-options/src/SeedOauthClientCredentialsMandatoryAuth.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/oauth-client-credentials-nested-root/src/SeedOauthClientCredentials.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/oauth-client-credentials-nested-root/src/SeedOauthClientCredentials.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/oauth-client-credentials-nested-root/src/SeedOauthClientCredentials.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/oauth-client-credentials-nested-root/src/SeedOauthClientCredentials.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/oauth-client-credentials-openapi/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/oauth-client-credentials-openapi/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/oauth-client-credentials-openapi/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/oauth-client-credentials-openapi/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/oauth-client-credentials-reference/src/SeedOauthClientCredentialsReference.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/oauth-client-credentials-reference/src/SeedOauthClientCredentialsReference.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/oauth-client-credentials-reference/src/SeedOauthClientCredentialsReference.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/oauth-client-credentials-reference/src/SeedOauthClientCredentialsReference.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/oauth-client-credentials-with-variables/src/SeedOauthClientCredentialsWithVariables.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/oauth-client-credentials-with-variables/src/SeedOauthClientCredentialsWithVariables.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/oauth-client-credentials-with-variables/src/SeedOauthClientCredentialsWithVariables.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/oauth-client-credentials-with-variables/src/SeedOauthClientCredentialsWithVariables.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/oauth-client-credentials/include-exception-handler/src/SeedOauthClientCredentials.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/oauth-client-credentials/include-exception-handler/src/SeedOauthClientCredentials.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/oauth-client-credentials/include-exception-handler/src/SeedOauthClientCredentials.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/oauth-client-credentials/include-exception-handler/src/SeedOauthClientCredentials.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/oauth-client-credentials/no-custom-config/src/SeedOauthClientCredentials.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/oauth-client-credentials/no-custom-config/src/SeedOauthClientCredentials.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/oauth-client-credentials/no-custom-config/src/SeedOauthClientCredentials.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/oauth-client-credentials/no-custom-config/src/SeedOauthClientCredentials.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/object/src/SeedObject.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/object/src/SeedObject.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/object/src/SeedObject.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/object/src/SeedObject.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/objects-with-imports/src/SeedObjectsWithImports.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/objects-with-imports/src/SeedObjectsWithImports.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/objects-with-imports/src/SeedObjectsWithImports.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/objects-with-imports/src/SeedObjectsWithImports.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/optional/no-custom-config/src/SeedObjectsWithImports.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/optional/no-custom-config/src/SeedObjectsWithImports.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/optional/no-custom-config/src/SeedObjectsWithImports.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/optional/no-custom-config/src/SeedObjectsWithImports.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/optional/simplify-object-dictionaries/src/SeedObjectsWithImports.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/optional/simplify-object-dictionaries/src/SeedObjectsWithImports.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/optional/simplify-object-dictionaries/src/SeedObjectsWithImports.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/optional/simplify-object-dictionaries/src/SeedObjectsWithImports.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/package-yml/src/SeedPackageYml.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/package-yml/src/SeedPackageYml.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/package-yml/src/SeedPackageYml.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/package-yml/src/SeedPackageYml.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/pagination-custom/src/SeedPagination.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/pagination-custom/src/SeedPagination.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/pagination-custom/src/SeedPagination.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/pagination-custom/src/SeedPagination.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/pagination-uri-path/src/SeedPaginationUriPath.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/pagination-uri-path/src/SeedPaginationUriPath.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/pagination-uri-path/src/SeedPaginationUriPath.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/pagination-uri-path/src/SeedPaginationUriPath.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/pagination/custom-pager-with-exception-handler/src/SeedPagination.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/pagination/custom-pager-with-exception-handler/src/SeedPagination.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/pagination/custom-pager-with-exception-handler/src/SeedPagination.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/pagination/custom-pager-with-exception-handler/src/SeedPagination.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/pagination/custom-pager/src/SeedPagination.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/pagination/custom-pager/src/SeedPagination.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/pagination/custom-pager/src/SeedPagination.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/pagination/custom-pager/src/SeedPagination.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/pagination/no-custom-config/src/SeedPagination.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/pagination/no-custom-config/src/SeedPagination.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/pagination/no-custom-config/src/SeedPagination.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/pagination/no-custom-config/src/SeedPagination.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/path-parameters/no-inline-path-parameters/src/SeedPathParameters.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/path-parameters/no-inline-path-parameters/src/SeedPathParameters.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/path-parameters/no-inline-path-parameters/src/SeedPathParameters.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/path-parameters/no-inline-path-parameters/src/SeedPathParameters.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/plain-text/src/SeedPlainText.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/plain-text/src/SeedPlainText.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/plain-text/src/SeedPlainText.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/plain-text/src/SeedPlainText.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/property-access/src/SeedPropertyAccess.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/property-access/src/SeedPropertyAccess.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/property-access/src/SeedPropertyAccess.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/property-access/src/SeedPropertyAccess.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/query-param-name-conflict/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/query-param-name-conflict/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/query-param-name-conflict/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/query-param-name-conflict/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/query-parameters-openapi-as-objects/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/query-parameters-openapi-as-objects/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/query-parameters-openapi-as-objects/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/query-parameters-openapi-as-objects/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/query-parameters-openapi/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/query-parameters-openapi/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/query-parameters-openapi/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/query-parameters-openapi/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/query-parameters/src/SeedQueryParameters.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/query-parameters/src/SeedQueryParameters.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/query-parameters/src/SeedQueryParameters.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/query-parameters/src/SeedQueryParameters.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/request-parameters/no-custom-config/src/SeedRequestParameters.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/request-parameters/no-custom-config/src/SeedRequestParameters.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/request-parameters/no-custom-config/src/SeedRequestParameters.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/request-parameters/no-custom-config/src/SeedRequestParameters.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/request-parameters/with-defaults/src/SeedRequestParameters.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/request-parameters/with-defaults/src/SeedRequestParameters.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/request-parameters/with-defaults/src/SeedRequestParameters.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/request-parameters/with-defaults/src/SeedRequestParameters.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/required-nullable/explicit-nullable-optional/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/required-nullable/explicit-nullable-optional/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/required-nullable/explicit-nullable-optional/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/required-nullable/explicit-nullable-optional/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/required-nullable/no-custom-config/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/required-nullable/no-custom-config/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/required-nullable/no-custom-config/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/required-nullable/no-custom-config/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/reserved-keywords/src/SeedNurseryApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/reserved-keywords/src/SeedNurseryApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/reserved-keywords/src/SeedNurseryApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/reserved-keywords/src/SeedNurseryApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/response-property/src/SeedResponseProperty.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/response-property/src/SeedResponseProperty.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/response-property/src/SeedResponseProperty.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/response-property/src/SeedResponseProperty.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/schemaless-request-body-examples/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/schemaless-request-body-examples/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/schemaless-request-body-examples/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/schemaless-request-body-examples/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/server-sent-event-examples/src/SeedServerSentEvents.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/server-sent-event-examples/src/SeedServerSentEvents.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/server-sent-event-examples/src/SeedServerSentEvents.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/server-sent-event-examples/src/SeedServerSentEvents.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/server-sent-events-openapi/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/server-sent-events-openapi/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/server-sent-events-openapi/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/server-sent-events-openapi/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/server-sent-events/src/SeedServerSentEvents.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/server-sent-events/src/SeedServerSentEvents.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/server-sent-events/src/SeedServerSentEvents.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/server-sent-events/src/SeedServerSentEvents.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/server-url-templating/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/server-url-templating/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/server-url-templating/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/server-url-templating/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/simple-api/custom-output-path-object/test/SeedApi.Test/SeedSimpleApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/simple-api/custom-output-path-object/test/SeedApi.Test/SeedSimpleApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/simple-api/custom-output-path-object/test/SeedApi.Test/SeedSimpleApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/simple-api/custom-output-path-object/test/SeedApi.Test/SeedSimpleApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/simple-api/custom-output-path/custom-src/SeedSimpleApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/simple-api/custom-output-path/custom-src/SeedSimpleApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/simple-api/custom-output-path/custom-src/SeedSimpleApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/simple-api/custom-output-path/custom-src/SeedSimpleApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/simple-api/no-custom-config/src/SeedSimpleApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/simple-api/no-custom-config/src/SeedSimpleApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/simple-api/no-custom-config/src/SeedSimpleApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/simple-api/no-custom-config/src/SeedSimpleApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/simple-api/use-sln-format/src/SeedSimpleApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/simple-api/use-sln-format/src/SeedSimpleApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/simple-api/use-sln-format/src/SeedSimpleApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/simple-api/use-sln-format/src/SeedSimpleApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/simple-fhir/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/simple-fhir/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/simple-fhir/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/simple-fhir/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/single-url-environment-default/src/SeedSingleUrlEnvironmentDefault.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/single-url-environment-default/src/SeedSingleUrlEnvironmentDefault.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/single-url-environment-default/src/SeedSingleUrlEnvironmentDefault.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/single-url-environment-default/src/SeedSingleUrlEnvironmentDefault.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/single-url-environment-no-default/src/SeedSingleUrlEnvironmentNoDefault.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/single-url-environment-no-default/src/SeedSingleUrlEnvironmentNoDefault.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/single-url-environment-no-default/src/SeedSingleUrlEnvironmentNoDefault.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/single-url-environment-no-default/src/SeedSingleUrlEnvironmentNoDefault.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/streaming-parameter/src/SeedStreaming.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/streaming-parameter/src/SeedStreaming.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/streaming-parameter/src/SeedStreaming.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/streaming-parameter/src/SeedStreaming.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/streaming/no-custom-config/src/SeedStreaming.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/streaming/no-custom-config/src/SeedStreaming.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/streaming/no-custom-config/src/SeedStreaming.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/streaming/no-custom-config/src/SeedStreaming.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/streaming/redact-response-body-on-error/src/SeedStreaming.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/streaming/redact-response-body-on-error/src/SeedStreaming.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/streaming/redact-response-body-on-error/src/SeedStreaming.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/streaming/redact-response-body-on-error/src/SeedStreaming.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/trace/src/SeedTrace.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/trace/src/SeedTrace.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/trace/src/SeedTrace.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/trace/src/SeedTrace.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/undiscriminated-union-with-response-property/src/SeedUndiscriminatedUnionWithResponseProperty.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/undiscriminated-union-with-response-property/src/SeedUndiscriminatedUnionWithResponseProperty.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/undiscriminated-union-with-response-property/src/SeedUndiscriminatedUnionWithResponseProperty.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/undiscriminated-union-with-response-property/src/SeedUndiscriminatedUnionWithResponseProperty.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/undiscriminated-unions/no-custom-config/src/SeedUndiscriminatedUnions.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/undiscriminated-unions/no-custom-config/src/SeedUndiscriminatedUnions.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/undiscriminated-unions/no-custom-config/src/SeedUndiscriminatedUnions.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/undiscriminated-unions/no-custom-config/src/SeedUndiscriminatedUnions.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/undiscriminated-unions/with-undiscriminated-unions/src/SeedUndiscriminatedUnions.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/undiscriminated-unions/with-undiscriminated-unions/src/SeedUndiscriminatedUnions.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/undiscriminated-unions/with-undiscriminated-unions/src/SeedUndiscriminatedUnions.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/undiscriminated-unions/with-undiscriminated-unions/src/SeedUndiscriminatedUnions.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/unions-with-local-date/src/SeedUnions.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/unions-with-local-date/src/SeedUnions.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/unions-with-local-date/src/SeedUnions.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/unions-with-local-date/src/SeedUnions.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/unions/no-custom-config/src/SeedUnions.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/unions/no-custom-config/src/SeedUnions.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/unions/no-custom-config/src/SeedUnions.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/unions/no-custom-config/src/SeedUnions.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/unions/no-discriminated-unions/src/SeedUnions.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/unions/no-discriminated-unions/src/SeedUnions.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/unions/no-discriminated-unions/src/SeedUnions.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/unions/no-discriminated-unions/src/SeedUnions.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/unknown/src/SeedUnknownAsAny.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/unknown/src/SeedUnknownAsAny.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/unknown/src/SeedUnknownAsAny.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/unknown/src/SeedUnknownAsAny.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/url-form-encoded/no-custom-config/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/url-form-encoded/no-custom-config/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/url-form-encoded/no-custom-config/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/url-form-encoded/no-custom-config/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/validation/src/SeedValidation.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/validation/src/SeedValidation.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/validation/src/SeedValidation.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/validation/src/SeedValidation.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/variables/src/SeedVariables.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/variables/src/SeedVariables.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/variables/src/SeedVariables.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/variables/src/SeedVariables.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/version-no-default/src/SeedVersion.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/version-no-default/src/SeedVersion.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/version-no-default/src/SeedVersion.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/version-no-default/src/SeedVersion.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/version/src/SeedVersion.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/version/src/SeedVersion.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/version/src/SeedVersion.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/version/src/SeedVersion.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/webhook-audience/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/webhook-audience/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/webhook-audience/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/webhook-audience/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/webhooks/src/SeedWebhooks.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/webhooks/src/SeedWebhooks.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/webhooks/src/SeedWebhooks.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/webhooks/src/SeedWebhooks.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/websocket-bearer-auth/src/SeedWebsocketBearerAuth.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/websocket-bearer-auth/src/SeedWebsocketBearerAuth.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/websocket-bearer-auth/src/SeedWebsocketBearerAuth.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/websocket-bearer-auth/src/SeedWebsocketBearerAuth.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/websocket-inferred-auth/src/SeedWebsocketAuth.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/websocket-inferred-auth/src/SeedWebsocketAuth.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/websocket-inferred-auth/src/SeedWebsocketAuth.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/websocket-inferred-auth/src/SeedWebsocketAuth.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/websocket-multi-url/no-custom-config/src/SeedWebsocketMultiUrl.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/websocket-multi-url/no-custom-config/src/SeedWebsocketMultiUrl.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/websocket-multi-url/no-custom-config/src/SeedWebsocketMultiUrl.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/websocket-multi-url/no-custom-config/src/SeedWebsocketMultiUrl.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/websocket/no-custom-config/src/SeedWebsocket.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/websocket/no-custom-config/src/SeedWebsocket.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/websocket/no-custom-config/src/SeedWebsocket.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/websocket/no-custom-config/src/SeedWebsocket.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/websocket/with-websockets/src/SeedWebsocket.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/websocket/with-websockets/src/SeedWebsocket.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/websocket/with-websockets/src/SeedWebsocket.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/websocket/with-websockets/src/SeedWebsocket.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/csharp-sdk/x-fern-default/src/SeedApi.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/x-fern-default/src/SeedApi.Test/Utils/JsonElementComparer.cs index a37ef402c1ac..36fa0e9d4ed1 100644 --- a/seed/csharp-sdk/x-fern-default/src/SeedApi.Test/Utils/JsonElementComparer.cs +++ b/seed/csharp-sdk/x-fern-default/src/SeedApi.Test/Utils/JsonElementComparer.cs @@ -92,8 +92,15 @@ private bool CompareJsonElements(JsonElement x, JsonElement y, string path) case JsonValueKind.Number: if (x.GetDecimal() != y.GetDecimal()) { - _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; - return false; + if (x.GetDouble() != y.GetDouble()) + { + if (x.GetSingle() != y.GetSingle()) + { + _failurePath = + $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + } } return true; diff --git a/seed/java-model/seed.yml b/seed/java-model/seed.yml index c8f6742546b8..000466495633 100644 --- a/seed/java-model/seed.yml +++ b/seed/java-model/seed.yml @@ -1,4 +1,4 @@ -irVersion: v58 +irVersion: v66 displayName: Java Model changelogLocation: ../../generators/java/model/versions.yml image: fernapi/fern-java-model diff --git a/seed/java-sdk/seed.yml b/seed/java-sdk/seed.yml index fa28deb9bf78..104e86d38497 100644 --- a/seed/java-sdk/seed.yml +++ b/seed/java-sdk/seed.yml @@ -1,4 +1,4 @@ -irVersion: v65 +irVersion: v66 displayName: Java SDK changelogLocation: ../../generators/java/sdk/versions.yml image: fernapi/fern-java-sdk diff --git a/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/types/__init__.py b/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/types/__init__.py index 033d048b4bbf..586fc57bc44d 100644 --- a/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/types/__init__.py +++ b/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/types/__init__.py @@ -18,8 +18,10 @@ ObjectWithDocs, ObjectWithDocumentedUnknownType, ObjectWithMapOfMap, + ObjectWithMixedRequiredAndOptionalFields, ObjectWithOptionalField, ObjectWithRequiredField, + ObjectWithRequiredNestedObject, ObjectWithUnknownField, OptionalAlias, WeatherReport, @@ -45,8 +47,10 @@ "ObjectWithDocs", "ObjectWithDocumentedUnknownType", "ObjectWithMapOfMap", + "ObjectWithMixedRequiredAndOptionalFields", "ObjectWithOptionalField", "ObjectWithRequiredField", + "ObjectWithRequiredNestedObject", "ObjectWithUnknownField", "OptionalAlias", "WeatherReport", diff --git a/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/types/resources/__init__.py b/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/types/resources/__init__.py index 19b405deddc0..f27fcabeed6a 100644 --- a/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/types/resources/__init__.py +++ b/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/types/resources/__init__.py @@ -14,8 +14,10 @@ ObjectWithDatetimeLikeString, ObjectWithDocumentedUnknownType, ObjectWithMapOfMap, + ObjectWithMixedRequiredAndOptionalFields, ObjectWithOptionalField, ObjectWithRequiredField, + ObjectWithRequiredNestedObject, ObjectWithUnknownField, OptionalAlias, ) @@ -37,8 +39,10 @@ "ObjectWithDocs", "ObjectWithDocumentedUnknownType", "ObjectWithMapOfMap", + "ObjectWithMixedRequiredAndOptionalFields", "ObjectWithOptionalField", "ObjectWithRequiredField", + "ObjectWithRequiredNestedObject", "ObjectWithUnknownField", "OptionalAlias", "WeatherReport", diff --git a/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/types/resources/object/__init__.py b/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/types/resources/object/__init__.py index 7c9ee033312a..092c1aa03a97 100644 --- a/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/types/resources/object/__init__.py +++ b/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/types/resources/object/__init__.py @@ -10,8 +10,10 @@ from .object_with_datetime_like_string import ObjectWithDatetimeLikeString from .object_with_documented_unknown_type import ObjectWithDocumentedUnknownType from .object_with_map_of_map import ObjectWithMapOfMap +from .object_with_mixed_required_and_optional_fields import ObjectWithMixedRequiredAndOptionalFields from .object_with_optional_field import ObjectWithOptionalField from .object_with_required_field import ObjectWithRequiredField +from .object_with_required_nested_object import ObjectWithRequiredNestedObject from .object_with_unknown_field import ObjectWithUnknownField from .optional_alias import OptionalAlias @@ -24,8 +26,10 @@ "ObjectWithDatetimeLikeString", "ObjectWithDocumentedUnknownType", "ObjectWithMapOfMap", + "ObjectWithMixedRequiredAndOptionalFields", "ObjectWithOptionalField", "ObjectWithRequiredField", + "ObjectWithRequiredNestedObject", "ObjectWithUnknownField", "OptionalAlias", ] diff --git a/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/types/resources/object/object_with_mixed_required_and_optional_fields.py b/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/types/resources/object/object_with_mixed_required_and_optional_fields.py new file mode 100644 index 000000000000..8f1903676ef4 --- /dev/null +++ b/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/types/resources/object/object_with_mixed_required_and_optional_fields.py @@ -0,0 +1,32 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +import typing_extensions +from .....core.pydantic_utilities import UniversalBaseModel +from .....core.serialization import FieldMetadata + + +class ObjectWithMixedRequiredAndOptionalFields(UniversalBaseModel): + """ + Tests that dynamic snippets include all required properties even when + the example data only provides a subset. In C#, properties marked as + `required` must be set in the object initializer. + """ + + required_string: typing_extensions.Annotated[ + str, FieldMetadata(alias="requiredString"), pydantic.Field(alias="requiredString") + ] + required_integer: typing_extensions.Annotated[ + int, FieldMetadata(alias="requiredInteger"), pydantic.Field(alias="requiredInteger") + ] + optional_string: typing_extensions.Annotated[ + typing.Optional[str], FieldMetadata(alias="optionalString"), pydantic.Field(alias="optionalString") + ] = None + required_long: typing_extensions.Annotated[ + int, FieldMetadata(alias="requiredLong"), pydantic.Field(alias="requiredLong") + ] + + class Config: + extra = pydantic.Extra.allow diff --git a/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/types/resources/object/object_with_required_nested_object.py b/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/types/resources/object/object_with_required_nested_object.py new file mode 100644 index 000000000000..35f268ef2d11 --- /dev/null +++ b/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/types/resources/object/object_with_required_nested_object.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +import pydantic +import typing_extensions +from .....core.pydantic_utilities import UniversalBaseModel +from .....core.serialization import FieldMetadata +from .nested_object_with_required_field import NestedObjectWithRequiredField + + +class ObjectWithRequiredNestedObject(UniversalBaseModel): + """ + Tests that dynamic snippets recursively construct default objects for + required properties whose type is a named object. The nested object's + own required properties should also be filled with defaults. + """ + + required_string: typing_extensions.Annotated[ + str, FieldMetadata(alias="requiredString"), pydantic.Field(alias="requiredString") + ] + required_object: typing_extensions.Annotated[ + NestedObjectWithRequiredField, FieldMetadata(alias="requiredObject"), pydantic.Field(alias="requiredObject") + ] + + class Config: + extra = pydantic.Extra.allow diff --git a/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/types/__init__.py b/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/types/__init__.py index 033d048b4bbf..586fc57bc44d 100644 --- a/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/types/__init__.py +++ b/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/types/__init__.py @@ -18,8 +18,10 @@ ObjectWithDocs, ObjectWithDocumentedUnknownType, ObjectWithMapOfMap, + ObjectWithMixedRequiredAndOptionalFields, ObjectWithOptionalField, ObjectWithRequiredField, + ObjectWithRequiredNestedObject, ObjectWithUnknownField, OptionalAlias, WeatherReport, @@ -45,8 +47,10 @@ "ObjectWithDocs", "ObjectWithDocumentedUnknownType", "ObjectWithMapOfMap", + "ObjectWithMixedRequiredAndOptionalFields", "ObjectWithOptionalField", "ObjectWithRequiredField", + "ObjectWithRequiredNestedObject", "ObjectWithUnknownField", "OptionalAlias", "WeatherReport", diff --git a/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/types/resources/__init__.py b/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/types/resources/__init__.py index 19b405deddc0..f27fcabeed6a 100644 --- a/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/types/resources/__init__.py +++ b/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/types/resources/__init__.py @@ -14,8 +14,10 @@ ObjectWithDatetimeLikeString, ObjectWithDocumentedUnknownType, ObjectWithMapOfMap, + ObjectWithMixedRequiredAndOptionalFields, ObjectWithOptionalField, ObjectWithRequiredField, + ObjectWithRequiredNestedObject, ObjectWithUnknownField, OptionalAlias, ) @@ -37,8 +39,10 @@ "ObjectWithDocs", "ObjectWithDocumentedUnknownType", "ObjectWithMapOfMap", + "ObjectWithMixedRequiredAndOptionalFields", "ObjectWithOptionalField", "ObjectWithRequiredField", + "ObjectWithRequiredNestedObject", "ObjectWithUnknownField", "OptionalAlias", "WeatherReport", diff --git a/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/types/resources/object/__init__.py b/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/types/resources/object/__init__.py index 7c9ee033312a..092c1aa03a97 100644 --- a/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/types/resources/object/__init__.py +++ b/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/types/resources/object/__init__.py @@ -10,8 +10,10 @@ from .object_with_datetime_like_string import ObjectWithDatetimeLikeString from .object_with_documented_unknown_type import ObjectWithDocumentedUnknownType from .object_with_map_of_map import ObjectWithMapOfMap +from .object_with_mixed_required_and_optional_fields import ObjectWithMixedRequiredAndOptionalFields from .object_with_optional_field import ObjectWithOptionalField from .object_with_required_field import ObjectWithRequiredField +from .object_with_required_nested_object import ObjectWithRequiredNestedObject from .object_with_unknown_field import ObjectWithUnknownField from .optional_alias import OptionalAlias @@ -24,8 +26,10 @@ "ObjectWithDatetimeLikeString", "ObjectWithDocumentedUnknownType", "ObjectWithMapOfMap", + "ObjectWithMixedRequiredAndOptionalFields", "ObjectWithOptionalField", "ObjectWithRequiredField", + "ObjectWithRequiredNestedObject", "ObjectWithUnknownField", "OptionalAlias", ] diff --git a/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/types/resources/object/object_with_mixed_required_and_optional_fields.py b/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/types/resources/object/object_with_mixed_required_and_optional_fields.py new file mode 100644 index 000000000000..b675613db519 --- /dev/null +++ b/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/types/resources/object/object_with_mixed_required_and_optional_fields.py @@ -0,0 +1,33 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +import typing_extensions +from .....core.pydantic_utilities import UniversalBaseModel +from .....core.serialization import FieldMetadata + + +class ObjectWithMixedRequiredAndOptionalFields(UniversalBaseModel): + """ + Tests that dynamic snippets include all required properties even when + the example data only provides a subset. In C#, properties marked as + `required` must be set in the object initializer. + """ + + required_string: typing_extensions.Annotated[ + str, FieldMetadata(alias="requiredString"), pydantic.Field(alias="requiredString") + ] + required_integer: typing_extensions.Annotated[ + int, FieldMetadata(alias="requiredInteger"), pydantic.Field(alias="requiredInteger") + ] + optional_string: typing_extensions.Annotated[ + typing.Optional[str], + FieldMetadata(alias="optionalString"), + pydantic.Field(alias="optionalString", default=None), + ] + required_long: typing_extensions.Annotated[ + int, FieldMetadata(alias="requiredLong"), pydantic.Field(alias="requiredLong") + ] + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") diff --git a/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/types/resources/object/object_with_required_nested_object.py b/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/types/resources/object/object_with_required_nested_object.py new file mode 100644 index 000000000000..47dad07ce764 --- /dev/null +++ b/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/types/resources/object/object_with_required_nested_object.py @@ -0,0 +1,26 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +import typing_extensions +from .....core.pydantic_utilities import UniversalBaseModel +from .....core.serialization import FieldMetadata +from .nested_object_with_required_field import NestedObjectWithRequiredField + + +class ObjectWithRequiredNestedObject(UniversalBaseModel): + """ + Tests that dynamic snippets recursively construct default objects for + required properties whose type is a named object. The nested object's + own required properties should also be filled with defaults. + """ + + required_string: typing_extensions.Annotated[ + str, FieldMetadata(alias="requiredString"), pydantic.Field(alias="requiredString") + ] + required_object: typing_extensions.Annotated[ + NestedObjectWithRequiredField, FieldMetadata(alias="requiredObject"), pydantic.Field(alias="requiredObject") + ] + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow")