@typespec/http-client-js 0.16.1 → 0.16.2-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +17 -13
- package/.github/copilot-instructions.md +0 -180
- package/.testignore +0 -19
- package/.turbo/turbo-build.log +0 -3
- package/CHANGELOG.md +0 -159
- package/eng/scripts/calculate-coverage.ts +0 -33
- package/eng/scripts/emit-e2e.ts +0 -317
- package/eng/scripts/run-e2e-tests.ts +0 -166
- package/eng/scripts/tspconfig.yaml +0 -6
- package/eng/scripts/upload-spector-results.ts +0 -139
- package/src/components/client-context/client-context-declaration.tsx +0 -26
- package/src/components/client-context/client-context-factory.tsx +0 -218
- package/src/components/client-context/client-context-options.tsx +0 -36
- package/src/components/client-context/client-context.tsx +0 -23
- package/src/components/client-context/parametrized-endpoint.tsx +0 -51
- package/src/components/client-directory.tsx +0 -51
- package/src/components/client-operation.tsx +0 -102
- package/src/components/client.tsx +0 -177
- package/src/components/encoding-provider.tsx +0 -17
- package/src/components/external-packages/ts-http-runtime.ts +0 -28
- package/src/components/external-packages/uri-template.ts +0 -11
- package/src/components/http-request-options.tsx +0 -88
- package/src/components/http-request-parameters-expression.tsx +0 -191
- package/src/components/http-request.tsx +0 -80
- package/src/components/http-response.tsx +0 -74
- package/src/components/index.ts +0 -12
- package/src/components/models.tsx +0 -26
- package/src/components/operation-handlers/index.tsx +0 -2
- package/src/components/operation-handlers/operation-pipeline.tsx +0 -33
- package/src/components/operation-handlers/paging/page-item.tsx +0 -14
- package/src/components/operation-handlers/paging/page-response.tsx +0 -57
- package/src/components/operation-handlers/paging/page-settings.tsx +0 -53
- package/src/components/operation-handlers/paging/paginated-operation-handler.tsx +0 -200
- package/src/components/operation-handlers/paging/request-send.tsx +0 -85
- package/src/components/operation-handlers/paging/response-deserialize.tsx +0 -60
- package/src/components/operation-handlers/paging/util.ts +0 -70
- package/src/components/operation-handlers/types.tsx +0 -18
- package/src/components/operation-options.tsx +0 -42
- package/src/components/operation-parameters.tsx +0 -44
- package/src/components/output.tsx +0 -32
- package/src/components/serializers.tsx +0 -74
- package/src/components/static-helpers/bytes-encoding.tsx +0 -61
- package/src/components/static-helpers/interfaces.tsx +0 -31
- package/src/components/static-helpers/multipart-helpers.tsx +0 -80
- package/src/components/static-helpers/paging-helper.tsx +0 -202
- package/src/components/static-helpers/rest-error.tsx +0 -102
- package/src/components/testing/client-options.tsx +0 -30
- package/src/components/transforms/content-type-encoding-provider.tsx +0 -26
- package/src/components/transforms/data-transform.tsx +0 -40
- package/src/components/transforms/json/json-array-transform.tsx +0 -87
- package/src/components/transforms/json/json-model-additional-properties-transform.tsx +0 -54
- package/src/components/transforms/json/json-model-base-transform.tsx +0 -24
- package/src/components/transforms/json/json-model-property-transform.tsx +0 -53
- package/src/components/transforms/json/json-model-transform.tsx +0 -115
- package/src/components/transforms/json/json-record-transform.tsx +0 -88
- package/src/components/transforms/json/json-transform-discriminator.tsx +0 -111
- package/src/components/transforms/json/json-transform.tsx +0 -120
- package/src/components/transforms/json/union-transform.tsx +0 -87
- package/src/components/transforms/json/utils/transport-namer.ts +0 -12
- package/src/components/transforms/multipart/array-part-transform.tsx +0 -44
- package/src/components/transforms/multipart/file-part-transform.tsx +0 -45
- package/src/components/transforms/multipart/multipart-transform.tsx +0 -30
- package/src/components/transforms/multipart/part-transform.tsx +0 -22
- package/src/components/transforms/multipart/simple-part-transform.tsx +0 -42
- package/src/components/transforms/operation-transform-declaration.tsx +0 -83
- package/src/components/transforms/operation-transform-expression.tsx +0 -62
- package/src/components/transforms/scalar-transform.tsx +0 -301
- package/src/components/transforms/transform-name-policy.ts +0 -134
- package/src/components/utils/unpack-model-property.ts +0 -44
- package/src/components/utils/url-template.tsx +0 -25
- package/src/context/encoding/encoding-context.tsx +0 -28
- package/src/context/encoding/types.ts +0 -6
- package/src/emitter.tsx +0 -85
- package/src/index.ts +0 -5
- package/src/lib.ts +0 -120
- package/src/testing/index.ts +0 -11
- package/src/utils/client-discovery.ts +0 -28
- package/src/utils/multipart.ts +0 -29
- package/src/utils/operations.ts +0 -112
- package/src/utils/parameters.tsx +0 -155
- package/test/e2e/assets/image.jpg +0 -0
- package/test/e2e/assets/image.png +0 -0
- package/test/e2e/http/authentication/api-key/main.test.ts +0 -38
- package/test/e2e/http/authentication/oauth2/main.test.ts +0 -31
- package/test/e2e/http/authentication/union/main.test.ts +0 -26
- package/test/e2e/http/encode/bytes/main.test.ts +0 -191
- package/test/e2e/http/encode/datetime/main.test.ts +0 -176
- package/test/e2e/http/encode/duration/main.test.ts +0 -126
- package/test/e2e/http/encode/numeric/main.test.ts +0 -26
- package/test/e2e/http/parameters/basic/main.test.ts +0 -35
- package/test/e2e/http/parameters/body-optionality/main.test.ts +0 -43
- package/test/e2e/http/parameters/collection-format/main.test.ts +0 -40
- package/test/e2e/http/parameters/spread/main.test.ts +0 -56
- package/test/e2e/http/payload/content-negotiation/main.test.ts +0 -40
- package/test/e2e/http/payload/json-merge-patch/main.test.ts +0 -122
- package/test/e2e/http/payload/media-type/main.test.ts +0 -28
- package/test/e2e/http/payload/multipart/main.test.ts +0 -200
- package/test/e2e/http/payload/pageable/main.test.ts +0 -78
- package/test/e2e/http/payload/xml/main.test.ts +0 -287
- package/test/e2e/http/routes/main.test.ts +0 -284
- package/test/e2e/http/serialization/encoded-name/json/main.test.ts +0 -20
- package/test/e2e/http/server/endpoint/not-defined/main.test.ts +0 -11
- package/test/e2e/http/server/path/multiple/main.test.ts +0 -22
- package/test/e2e/http/server/path/single/main.test.ts +0 -11
- package/test/e2e/http/server/versions/not-versioned/main.test.ts +0 -22
- package/test/e2e/http/server/versions/versioned/main.test.ts +0 -28
- package/test/e2e/http/special-headers/conditional-request/main.test.ts +0 -35
- package/test/e2e/http/special-headers/repeatability/main.test.ts +0 -18
- package/test/e2e/http/special-words/main.test.ts +0 -434
- package/test/e2e/http/type/array/array.test.ts +0 -256
- package/test/e2e/http/type/dictionary/main.test.ts +0 -229
- package/test/e2e/http/type/enum/extensible/main.test.ts +0 -34
- package/test/e2e/http/type/enum/fixed/main.test.ts +0 -29
- package/test/e2e/http/type/model/empty/main.test.ts +0 -21
- package/test/e2e/http/type/model/inheritance/enum-discriminator/main.test.ts +0 -51
- package/test/e2e/http/type/model/inheritance/nested-discriminator/main.test.ts +0 -168
- package/test/e2e/http/type/model/inheritance/not-discriminated/main.test.ts +0 -42
- package/test/e2e/http/type/model/inheritance/recursive/main.test.ts +0 -46
- package/test/e2e/http/type/model/inheritance/single-discriminator/main.test.ts +0 -99
- package/test/e2e/http/type/model/visibility/main.test.ts +0 -64
- package/test/e2e/http/type/property/additional-properties/main.test.ts +0 -185
- package/test/e2e/http/type/property/additional-properties/spreads.test.ts +0 -448
- package/test/e2e/http/type/property/nullable/main.test.ts +0 -275
- package/test/e2e/http/type/property/optionality/main.test.ts +0 -256
- package/test/e2e/http/type/property/value-types/main.test.ts +0 -193
- package/test/e2e/http/type/scalar/main.test.ts +0 -133
- package/test/e2e/http/type/scalar/scalar.test.ts +0 -95
- package/test/e2e/http/type/union/main.test.ts +0 -207
- package/test/e2e/http/versioning/added/main.test.ts +0 -60
- package/test/e2e/http/versioning/madeOptional/main.test.ts +0 -34
- package/test/e2e/http/versioning/removed/main.test.ts +0 -75
- package/test/e2e/http/versioning/renamedFrom/main.test.ts +0 -52
- package/test/e2e/http/versioning/returnTypeChangedFrom/main.test.ts +0 -22
- package/test/e2e/http/versioning/typeChangedFrom/main.test.ts +0 -31
- package/test/scenarios/additional-properties/extends.md +0 -67
- package/test/scenarios/additional-properties/is.md +0 -42
- package/test/scenarios/additional-properties/spread.md +0 -68
- package/test/scenarios/auth/basic_auth.md +0 -68
- package/test/scenarios/auth/bearer.md +0 -68
- package/test/scenarios/auth/client_parameters.md +0 -78
- package/test/scenarios/auth/client_structure.md +0 -36
- package/test/scenarios/auth/key_credential.md +0 -69
- package/test/scenarios/auth/oauth2.md +0 -90
- package/test/scenarios/auth/sub_client_override.md +0 -114
- package/test/scenarios/client/client_context.md +0 -34
- package/test/scenarios/client/dotted_namespace.md +0 -27
- package/test/scenarios/client/global_namespace.md +0 -69
- package/test/scenarios/client/multiple_top_level_clients.md +0 -72
- package/test/scenarios/client/nested_client.md +0 -102
- package/test/scenarios/client/wrapping_namespace.md +0 -41
- package/test/scenarios/encoding/bytes_body.md +0 -44
- package/test/scenarios/encoding/bytes_json_property.md +0 -55
- package/test/scenarios/encoding/bytes_nullable.md +0 -139
- package/test/scenarios/encoding/header_bytes.md +0 -130
- package/test/scenarios/encoding/header_date.md +0 -216
- package/test/scenarios/encoding/model_with_bytes_property.md +0 -45
- package/test/scenarios/encoding/query_bytes.md +0 -42
- package/test/scenarios/encoding/query_date.md +0 -216
- package/test/scenarios/http-operations/basic-request.md +0 -144
- package/test/scenarios/http-operations/basic-response.md +0 -219
- package/test/scenarios/http-operations/basic.md +0 -128
- package/test/scenarios/http-operations/constant-header.md +0 -33
- package/test/scenarios/http-operations/create-operation.md +0 -58
- package/test/scenarios/http-operations/on_response.md +0 -52
- package/test/scenarios/http-operations/optional-request-body.md +0 -50
- package/test/scenarios/http-operations/paging.md +0 -242
- package/test/scenarios/http-operations/path-parameter-in-model.md +0 -53
- package/test/scenarios/http-operations/path-parameter.md +0 -48
- package/test/scenarios/http-operations/query-parameter.md +0 -41
- package/test/scenarios/http-operations/scalar-payload.md +0 -57
- package/test/scenarios/http-operations/with-parameters.md +0 -78
- package/test/scenarios/models/array-properties.md +0 -47
- package/test/scenarios/models/basic.md +0 -118
- package/test/scenarios/models/dictionary-properties.md +0 -44
- package/test/scenarios/models/inheritance_2_discriminators.md +0 -346
- package/test/scenarios/models/inheritance_discriminator.md +0 -88
- package/test/scenarios/models/inline-models.md +0 -29
- package/test/scenarios/models/model_additional_properties.md +0 -75
- package/test/scenarios/models/model_extends.md +0 -97
- package/test/scenarios/models/model_spread.md +0 -63
- package/test/scenarios/models/nested_property.md +0 -41
- package/test/scenarios/models/property_references_property.md +0 -150
- package/test/scenarios/multipart/anonymous_part.md +0 -53
- package/test/scenarios/multipart/file.md +0 -154
- package/test/scenarios/multipart/file_content_type.md +0 -92
- package/test/scenarios/multipart/non-string-float.md +0 -55
- package/test/scenarios/multipart/simple_part.md +0 -65
- package/test/scenarios/operation-parameters/body_root_anonymous.md +0 -87
- package/test/scenarios/operation-parameters/constant_as_optional.md +0 -54
- package/test/scenarios/operation-parameters/default_value_as_optional.md +0 -54
- package/test/scenarios/operation-parameters/no_content_type.md +0 -62
- package/test/scenarios/operation-parameters/no_parameters.md +0 -50
- package/test/scenarios/operation-parameters/only_optional.md +0 -62
- package/test/scenarios/operation-parameters/only_required.md +0 -58
- package/test/scenarios/operation-parameters/reserved_names.md +0 -60
- package/test/scenarios/operation-parameters/spread_body.md +0 -70
- package/test/scenarios/operation-parameters/spread_with_nested.md +0 -82
- package/test/scenarios/operation-parameters/union_body.md +0 -86
- package/test/scenarios/operation-parameters/with_body_property.md +0 -67
- package/test/scenarios/operation-parameters/with_body_root.md +0 -69
- package/test/scenarios/serializers/arrays.md +0 -191
- package/test/scenarios/serializers/basic_model.md +0 -111
- package/test/scenarios/serializers/basic_model_wire_name.md +0 -48
- package/test/scenarios/serializers/discriminated_union.md +0 -86
- package/test/scenarios/serializers/discriminated_union_spread.md +0 -115
- package/test/scenarios/serializers/file.md +0 -67
- package/test/scenarios/serializers/model_date_time.md +0 -65
- package/test/scenarios/serializers/multipart.md +0 -62
- package/test/scenarios/serializers/polymorphic_single_level_inheritance.md +0 -157
- package/test/scenarios/serializers/property_references_property.md +0 -72
- package/test/scenarios/serializers/record.md +0 -97
- package/test/scenarios/serializers/scalars.md +0 -34
- package/test/scenarios/serializers/spread.md +0 -69
- package/test/scenarios/serializers/string_union.md +0 -55
- package/test/scenarios/server/default_url.md +0 -45
- package/test/scenarios/server/multiple-parameters.md +0 -55
- package/test/scenarios/server/no-server.md +0 -37
- package/test/scenarios/server/parametrized-endpoint.md +0 -51
- package/test/scenarios.test.ts +0 -24
- package/test/test-host.ts +0 -22
- package/tsconfig.json +0 -16
- package/tsconfig.test.json +0 -9
- package/vitest.config.e2e.ts +0 -16
- package/vitest.config.ts +0 -15
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import type { Eagle } from "../../../../../generated/type/model/inheritance/single-discriminator/src/index.js";
|
|
3
|
-
import { SingleDiscriminatorClient } from "../../../../../generated/type/model/inheritance/single-discriminator/src/index.js";
|
|
4
|
-
|
|
5
|
-
describe("Type.Model.Inheritance.SingleDiscriminator", () => {
|
|
6
|
-
const client = new SingleDiscriminatorClient({
|
|
7
|
-
allowInsecureConnection: true,
|
|
8
|
-
retryOptions: {
|
|
9
|
-
maxRetries: 0,
|
|
10
|
-
},
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
it("should receive polymorphic model in single level inheritance with 1 discriminator", async () => {
|
|
14
|
-
const response = await client.getModel();
|
|
15
|
-
expect(response).toEqual({
|
|
16
|
-
wingspan: 1,
|
|
17
|
-
kind: "sparrow",
|
|
18
|
-
});
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
it("should send polymorphic model in single level inheritance with 1 discriminator", async () => {
|
|
22
|
-
await client.putModel({
|
|
23
|
-
wingspan: 1,
|
|
24
|
-
kind: "sparrow",
|
|
25
|
-
});
|
|
26
|
-
// Assert successful request
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
it("should receive polymorphic models with collection and dictionary properties referring to other polymorphic models", async () => {
|
|
30
|
-
const response = await client.getRecursiveModel();
|
|
31
|
-
expect(response).toEqual({
|
|
32
|
-
wingspan: 5,
|
|
33
|
-
kind: "eagle",
|
|
34
|
-
partner: {
|
|
35
|
-
wingspan: 2,
|
|
36
|
-
kind: "goose",
|
|
37
|
-
},
|
|
38
|
-
friends: [
|
|
39
|
-
{
|
|
40
|
-
wingspan: 2,
|
|
41
|
-
kind: "seagull",
|
|
42
|
-
},
|
|
43
|
-
],
|
|
44
|
-
hate: {
|
|
45
|
-
key3: {
|
|
46
|
-
wingspan: 1,
|
|
47
|
-
kind: "sparrow",
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
it("should send polymorphic models with collection and dictionary properties referring to other polymorphic models", async () => {
|
|
54
|
-
await client.putRecursiveModel({
|
|
55
|
-
wingspan: 5,
|
|
56
|
-
kind: "eagle",
|
|
57
|
-
partner: {
|
|
58
|
-
wingspan: 2,
|
|
59
|
-
kind: "goose",
|
|
60
|
-
},
|
|
61
|
-
friends: [
|
|
62
|
-
{
|
|
63
|
-
wingspan: 2,
|
|
64
|
-
kind: "seagull",
|
|
65
|
-
},
|
|
66
|
-
],
|
|
67
|
-
hate: {
|
|
68
|
-
key3: {
|
|
69
|
-
wingspan: 1,
|
|
70
|
-
kind: "sparrow",
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
} as Eagle);
|
|
74
|
-
// Assert successful request
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
it("should handle a model omitting the discriminator", async () => {
|
|
78
|
-
const response = await client.getMissingDiscriminator();
|
|
79
|
-
expect(response).toEqual({
|
|
80
|
-
wingspan: 1,
|
|
81
|
-
});
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
it("should handle a model containing a discriminator value that was never defined", async () => {
|
|
85
|
-
const response = await client.getWrongDiscriminator();
|
|
86
|
-
expect(response).toEqual({
|
|
87
|
-
wingspan: 1,
|
|
88
|
-
kind: "wrongKind",
|
|
89
|
-
});
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
it("should receive polymorphic model defined in a legacy way", async () => {
|
|
93
|
-
const response = await client.getLegacyModel();
|
|
94
|
-
expect(response).toEqual({
|
|
95
|
-
size: 20,
|
|
96
|
-
kind: "t-rex",
|
|
97
|
-
});
|
|
98
|
-
});
|
|
99
|
-
});
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { VisibilityClient } from "../../../../generated/type/model/visibility/src/index.js";
|
|
3
|
-
|
|
4
|
-
describe("Type.Model.Visibility", () => {
|
|
5
|
-
const client = new VisibilityClient({ allowInsecureConnection: true });
|
|
6
|
-
|
|
7
|
-
it.skip("should generate and receive an output model with readonly properties (getModel)", async () => {
|
|
8
|
-
const input = {
|
|
9
|
-
queryProp: 123,
|
|
10
|
-
};
|
|
11
|
-
const response = await client.getModel(input as any);
|
|
12
|
-
expect(response.readProp).toBe("abc");
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
it.skip("should send a model with write/create properties (headModel)", async () => {
|
|
16
|
-
const input = {
|
|
17
|
-
queryProp: 123,
|
|
18
|
-
};
|
|
19
|
-
await client.headModel(input as any);
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it("should send a model with write/create/update properties (putModel)", async () => {
|
|
23
|
-
const input = {
|
|
24
|
-
createProp: ["foo", "bar"],
|
|
25
|
-
updateProp: [1, 2],
|
|
26
|
-
};
|
|
27
|
-
await client.putModel(input as any);
|
|
28
|
-
// Assert successful request
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
it("should send a model with write/update properties (patchModel)", async () => {
|
|
32
|
-
const input = {
|
|
33
|
-
updateProp: [1, 2],
|
|
34
|
-
};
|
|
35
|
-
await client.patchModel(input as any);
|
|
36
|
-
// Assert successful request
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
it("should send a model with write/create properties (postModel)", async () => {
|
|
40
|
-
const input = {
|
|
41
|
-
createProp: ["foo", "bar"],
|
|
42
|
-
};
|
|
43
|
-
await client.postModel(input as any);
|
|
44
|
-
// Assert successful request
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it("should send a model with write/delete properties (deleteModel)", async () => {
|
|
48
|
-
const input = {
|
|
49
|
-
deleteProp: true,
|
|
50
|
-
};
|
|
51
|
-
await client.deleteModel(input as any);
|
|
52
|
-
// Assert successful request
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
it("should send and receive a model with readonly properties (putReadOnlyModel)", async () => {
|
|
56
|
-
const input = {};
|
|
57
|
-
const response = await client.putReadOnlyModel(input);
|
|
58
|
-
expect(response.optionalNullableIntList).toEqual([1, 2, 3]);
|
|
59
|
-
expect(response.optionalStringRecord).toEqual({
|
|
60
|
-
k1: "value1",
|
|
61
|
-
k2: "value2",
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
});
|
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import type { ExtendsUnknownAdditionalPropertiesDiscriminatedDerived } from "../../../../generated/type/property/additional-properties/src/index.js";
|
|
3
|
-
import {
|
|
4
|
-
ExtendsUnknownClient,
|
|
5
|
-
ExtendsUnknownDerivedClient,
|
|
6
|
-
ExtendsUnknownDiscriminatedClient,
|
|
7
|
-
IsUnknownClient,
|
|
8
|
-
IsUnknownDerivedClient,
|
|
9
|
-
IsUnknownDiscriminatedClient,
|
|
10
|
-
} from "../../../../generated/type/property/additional-properties/src/index.js";
|
|
11
|
-
|
|
12
|
-
describe("Type.Property.AdditionalProperties", () => {
|
|
13
|
-
describe("ExtendsUnknownClient", () => {
|
|
14
|
-
const client = new ExtendsUnknownClient({
|
|
15
|
-
allowInsecureConnection: true,
|
|
16
|
-
retryOptions: {
|
|
17
|
-
maxRetries: 1,
|
|
18
|
-
},
|
|
19
|
-
});
|
|
20
|
-
it("Expected response body: {'name': 'ExtendsUnknownAdditionalProperties', 'prop1': 32, 'prop2': true, 'prop3': 'abc'}", async () => {
|
|
21
|
-
const response = await client.get();
|
|
22
|
-
expect(response).toEqual({
|
|
23
|
-
additionalProperties: {
|
|
24
|
-
prop1: 32,
|
|
25
|
-
prop2: true,
|
|
26
|
-
prop3: "abc",
|
|
27
|
-
},
|
|
28
|
-
name: "ExtendsUnknownAdditionalProperties",
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
it("Expected input body: {'name': 'ExtendsUnknownAdditionalProperties', 'prop1': 32, 'prop2': true, 'prop3': 'abc'}", async () => {
|
|
32
|
-
await client.put({
|
|
33
|
-
additionalProperties: { prop1: 32, prop2: true, prop3: "abc" },
|
|
34
|
-
name: "ExtendsUnknownAdditionalProperties",
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
describe("ExtendsUnknownDerivedClient", () => {
|
|
40
|
-
const client = new ExtendsUnknownDerivedClient({
|
|
41
|
-
allowInsecureConnection: true,
|
|
42
|
-
retryOptions: {
|
|
43
|
-
maxRetries: 1,
|
|
44
|
-
},
|
|
45
|
-
});
|
|
46
|
-
it("Expected response body: {'name': 'ExtendsUnknownAdditionalProperties', 'index': 314, 'age': 2.71875, 'prop1': 32, 'prop2': true, 'prop3': 'abc'}", async () => {
|
|
47
|
-
const response = await client.get();
|
|
48
|
-
expect(response).toEqual({
|
|
49
|
-
additionalProperties: {
|
|
50
|
-
prop1: 32,
|
|
51
|
-
prop2: true,
|
|
52
|
-
prop3: "abc",
|
|
53
|
-
},
|
|
54
|
-
name: "ExtendsUnknownAdditionalProperties",
|
|
55
|
-
index: 314,
|
|
56
|
-
age: 2.71875,
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
it("Expected input body: {'name': 'ExtendsUnknownAdditionalProperties', 'index': 314, 'age': 2.71875, 'prop1': 32, 'prop2': true, 'prop3': 'abc'}", async () => {
|
|
60
|
-
await client.put({
|
|
61
|
-
name: "ExtendsUnknownAdditionalProperties",
|
|
62
|
-
index: 314,
|
|
63
|
-
age: 2.71875,
|
|
64
|
-
additionalProperties: { prop1: 32, prop2: true, prop3: "abc" },
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
describe("ExtendsUnknownDiscriminatedClient", () => {
|
|
70
|
-
const client = new ExtendsUnknownDiscriminatedClient({
|
|
71
|
-
allowInsecureConnection: true,
|
|
72
|
-
retryOptions: {
|
|
73
|
-
maxRetries: 1,
|
|
74
|
-
},
|
|
75
|
-
});
|
|
76
|
-
it("Expected response body: {'kind': 'derived', 'name': 'Derived', 'index': 314, 'age': 2.71875, 'prop1': 32, 'prop2': true, 'prop3': 'abc'}", async () => {
|
|
77
|
-
const response = await client.get();
|
|
78
|
-
expect(response).toEqual({
|
|
79
|
-
additionalProperties: { prop1: 32, prop2: true, prop3: "abc" },
|
|
80
|
-
kind: "derived",
|
|
81
|
-
name: "Derived",
|
|
82
|
-
index: 314,
|
|
83
|
-
age: 2.71875,
|
|
84
|
-
});
|
|
85
|
-
});
|
|
86
|
-
it("Expected input body: {'kind': 'derived', 'name': 'Derived', 'index': 314, 'age': 2.71875, 'prop1': 32, 'prop2': true, 'prop3': 'abc'}", async () => {
|
|
87
|
-
const input: ExtendsUnknownAdditionalPropertiesDiscriminatedDerived = {
|
|
88
|
-
index: 314,
|
|
89
|
-
age: 2.71875,
|
|
90
|
-
kind: "derived",
|
|
91
|
-
name: "Derived",
|
|
92
|
-
additionalProperties: {
|
|
93
|
-
prop1: 32,
|
|
94
|
-
prop2: true,
|
|
95
|
-
prop3: "abc",
|
|
96
|
-
},
|
|
97
|
-
};
|
|
98
|
-
await client.put(input);
|
|
99
|
-
});
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
describe("IsUnknownClient", () => {
|
|
103
|
-
const client = new IsUnknownClient({ allowInsecureConnection: true });
|
|
104
|
-
it("Expected response body: {'name': 'IsUnknownAdditionalProperties', 'prop1': 32, 'prop2': true, 'prop3': 'abc'}", async () => {
|
|
105
|
-
const response = await client.get();
|
|
106
|
-
expect(response).toEqual({
|
|
107
|
-
name: "IsUnknownAdditionalProperties",
|
|
108
|
-
additionalProperties: { prop1: 32, prop2: true, prop3: "abc" },
|
|
109
|
-
});
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
it("Expected input body: {'name': 'IsUnknownAdditionalProperties', 'prop1': 32, 'prop2': true, 'prop3': 'abc'}", async () => {
|
|
113
|
-
await client.put({
|
|
114
|
-
name: "IsUnknownAdditionalProperties",
|
|
115
|
-
additionalProperties: {
|
|
116
|
-
prop1: 32,
|
|
117
|
-
prop2: true,
|
|
118
|
-
prop3: "abc",
|
|
119
|
-
},
|
|
120
|
-
});
|
|
121
|
-
});
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
describe("IsUnknownDerivedClient", () => {
|
|
125
|
-
const client = new IsUnknownDerivedClient({
|
|
126
|
-
allowInsecureConnection: true,
|
|
127
|
-
retryOptions: {
|
|
128
|
-
maxRetries: 1,
|
|
129
|
-
},
|
|
130
|
-
});
|
|
131
|
-
it("Expected response body: {'name': 'IsUnknownAdditionalProperties', 'index': 314, 'age': 2.71875, 'prop1': 32, 'prop2': true, 'prop3': 'abc'}", async () => {
|
|
132
|
-
const response = await client.get();
|
|
133
|
-
expect(response).toEqual({
|
|
134
|
-
name: "IsUnknownAdditionalProperties",
|
|
135
|
-
index: 314,
|
|
136
|
-
age: 2.71875,
|
|
137
|
-
additionalProperties: { prop1: 32, prop2: true, prop3: "abc" },
|
|
138
|
-
});
|
|
139
|
-
});
|
|
140
|
-
it("Expected input body: {'name': 'IsUnknownAdditionalProperties', 'index': 314, 'age': 2.71875, 'prop1': 32, 'prop2': true, 'prop3': 'abc'}", async () => {
|
|
141
|
-
await client.put({
|
|
142
|
-
name: "IsUnknownAdditionalProperties",
|
|
143
|
-
index: 314,
|
|
144
|
-
age: 2.71875,
|
|
145
|
-
additionalProperties: {
|
|
146
|
-
prop1: 32,
|
|
147
|
-
prop2: true,
|
|
148
|
-
prop3: "abc",
|
|
149
|
-
},
|
|
150
|
-
});
|
|
151
|
-
});
|
|
152
|
-
});
|
|
153
|
-
|
|
154
|
-
describe("IsUnknownDiscriminatedClient", () => {
|
|
155
|
-
const client = new IsUnknownDiscriminatedClient({
|
|
156
|
-
allowInsecureConnection: true,
|
|
157
|
-
retryOptions: {
|
|
158
|
-
maxRetries: 1,
|
|
159
|
-
},
|
|
160
|
-
});
|
|
161
|
-
it("Expected response body: {'kind': 'derived', 'name': 'Derived', 'index': 314, 'age': 2.71875, 'prop1': 32, 'prop2': true, 'prop3': 'abc'}", async () => {
|
|
162
|
-
const response = await client.get();
|
|
163
|
-
expect(response).toEqual({
|
|
164
|
-
kind: "derived",
|
|
165
|
-
name: "Derived",
|
|
166
|
-
index: 314,
|
|
167
|
-
age: 2.71875,
|
|
168
|
-
additionalProperties: { prop1: 32, prop2: true, prop3: "abc" },
|
|
169
|
-
});
|
|
170
|
-
});
|
|
171
|
-
it("Expected input body: {'kind': 'derived', 'name': 'Derived', 'index': 314, 'age': 2.71875, 'prop1': 32, 'prop2': true, 'prop3': 'abc'}", async () => {
|
|
172
|
-
await client.put({
|
|
173
|
-
kind: "derived",
|
|
174
|
-
name: "Derived",
|
|
175
|
-
index: 314,
|
|
176
|
-
age: 2.71875,
|
|
177
|
-
additionalProperties: {
|
|
178
|
-
prop1: 32,
|
|
179
|
-
prop2: true,
|
|
180
|
-
prop3: "abc",
|
|
181
|
-
},
|
|
182
|
-
} as any);
|
|
183
|
-
});
|
|
184
|
-
});
|
|
185
|
-
});
|