@typespec/http-client-js 0.1.0
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/.testignore +2 -0
- package/LICENSE +21 -0
- package/README.md +26 -0
- package/babel.config.js +4 -0
- package/dist/src/components/client-context/client-context-declaration.d.ts +8 -0
- package/dist/src/components/client-context/client-context-declaration.d.ts.map +1 -0
- package/dist/src/components/client-context/client-context-declaration.js +21 -0
- package/dist/src/components/client-context/client-context-declaration.js.map +1 -0
- package/dist/src/components/client-context/client-context-factory.d.ts +8 -0
- package/dist/src/components/client-context/client-context-factory.d.ts.map +1 -0
- package/dist/src/components/client-context/client-context-factory.js +154 -0
- package/dist/src/components/client-context/client-context-factory.js.map +1 -0
- package/dist/src/components/client-context/client-context-options.d.ts +8 -0
- package/dist/src/components/client-context/client-context-options.d.ts.map +1 -0
- package/dist/src/components/client-context/client-context-options.js +42 -0
- package/dist/src/components/client-context/client-context-options.js.map +1 -0
- package/dist/src/components/client-context/client-context.d.ts +8 -0
- package/dist/src/components/client-context/client-context.d.ts.map +1 -0
- package/dist/src/components/client-context/client-context.js +33 -0
- package/dist/src/components/client-context/client-context.js.map +1 -0
- package/dist/src/components/client-context/parametrized-endpoint.d.ts +9 -0
- package/dist/src/components/client-context/parametrized-endpoint.d.ts.map +1 -0
- package/dist/src/components/client-context/parametrized-endpoint.js +48 -0
- package/dist/src/components/client-context/parametrized-endpoint.js.map +1 -0
- package/dist/src/components/client-directory.d.ts +11 -0
- package/dist/src/components/client-directory.d.ts.map +1 -0
- package/dist/src/components/client-directory.js +39 -0
- package/dist/src/components/client-directory.js.map +1 -0
- package/dist/src/components/client-operation.d.ts +11 -0
- package/dist/src/components/client-operation.d.ts.map +1 -0
- package/dist/src/components/client-operation.js +74 -0
- package/dist/src/components/client-operation.js.map +1 -0
- package/dist/src/components/client.d.ts +15 -0
- package/dist/src/components/client.d.ts.map +1 -0
- package/dist/src/components/client.js +153 -0
- package/dist/src/components/client.js.map +1 -0
- package/dist/src/components/encoding-provider.d.ts +8 -0
- package/dist/src/components/encoding-provider.d.ts.map +1 -0
- package/dist/src/components/encoding-provider.js +17 -0
- package/dist/src/components/encoding-provider.js.map +1 -0
- package/dist/src/components/external-packages/ts-http-runtime.d.ts +13 -0
- package/dist/src/components/external-packages/ts-http-runtime.d.ts.map +1 -0
- package/dist/src/components/external-packages/ts-http-runtime.js +11 -0
- package/dist/src/components/external-packages/ts-http-runtime.js.map +1 -0
- package/dist/src/components/external-packages/uri-template.d.ts +4 -0
- package/dist/src/components/external-packages/uri-template.d.ts.map +1 -0
- package/dist/src/components/external-packages/uri-template.js +11 -0
- package/dist/src/components/external-packages/uri-template.js.map +1 -0
- package/dist/src/components/http-request-options.d.ts +25 -0
- package/dist/src/components/http-request-options.d.ts.map +1 -0
- package/dist/src/components/http-request-options.js +74 -0
- package/dist/src/components/http-request-options.js.map +1 -0
- package/dist/src/components/http-request-parameters-expression.d.ts +10 -0
- package/dist/src/components/http-request-parameters-expression.d.ts.map +1 -0
- package/dist/src/components/http-request-parameters-expression.js +62 -0
- package/dist/src/components/http-request-parameters-expression.js.map +1 -0
- package/dist/src/components/http-request.d.ts +16 -0
- package/dist/src/components/http-request.d.ts.map +1 -0
- package/dist/src/components/http-request.js +70 -0
- package/dist/src/components/http-request.js.map +1 -0
- package/dist/src/components/http-response.d.ts +14 -0
- package/dist/src/components/http-response.d.ts.map +1 -0
- package/dist/src/components/http-response.js +61 -0
- package/dist/src/components/http-response.js.map +1 -0
- package/dist/src/components/models.d.ts +5 -0
- package/dist/src/components/models.d.ts.map +1 -0
- package/dist/src/components/models.js +41 -0
- package/dist/src/components/models.js.map +1 -0
- package/dist/src/components/operation-options.d.ts +8 -0
- package/dist/src/components/operation-options.d.ts.map +1 -0
- package/dist/src/components/operation-options.js +41 -0
- package/dist/src/components/operation-options.js.map +1 -0
- package/dist/src/components/operation-parameters.d.ts +9 -0
- package/dist/src/components/operation-parameters.d.ts.map +1 -0
- package/dist/src/components/operation-parameters.js +33 -0
- package/dist/src/components/operation-parameters.js.map +1 -0
- package/dist/src/components/output.d.ts +6 -0
- package/dist/src/components/output.d.ts.map +1 -0
- package/dist/src/components/output.js +35 -0
- package/dist/src/components/output.js.map +1 -0
- package/dist/src/components/serializers.d.ts +5 -0
- package/dist/src/components/serializers.d.ts.map +1 -0
- package/dist/src/components/serializers.js +43 -0
- package/dist/src/components/serializers.js.map +1 -0
- package/dist/src/components/static-helpers/bytes-encoding.d.ts +6 -0
- package/dist/src/components/static-helpers/bytes-encoding.d.ts.map +1 -0
- package/dist/src/components/static-helpers/bytes-encoding.js +68 -0
- package/dist/src/components/static-helpers/bytes-encoding.js.map +1 -0
- package/dist/src/components/static-helpers/interfaces.d.ts +5 -0
- package/dist/src/components/static-helpers/interfaces.d.ts.map +1 -0
- package/dist/src/components/static-helpers/interfaces.js +41 -0
- package/dist/src/components/static-helpers/interfaces.js.map +1 -0
- package/dist/src/components/static-helpers/multipart-helpers.d.ts +8 -0
- package/dist/src/components/static-helpers/multipart-helpers.d.ts.map +1 -0
- package/dist/src/components/static-helpers/multipart-helpers.js +83 -0
- package/dist/src/components/static-helpers/multipart-helpers.js.map +1 -0
- package/dist/src/components/static-helpers/rest-error.d.ts +5 -0
- package/dist/src/components/static-helpers/rest-error.d.ts.map +1 -0
- package/dist/src/components/static-helpers/rest-error.js +127 -0
- package/dist/src/components/static-helpers/rest-error.js.map +1 -0
- package/dist/src/components/testing/client-options.d.ts +8 -0
- package/dist/src/components/testing/client-options.d.ts.map +1 -0
- package/dist/src/components/testing/client-options.js +27 -0
- package/dist/src/components/testing/client-options.js.map +1 -0
- package/dist/src/components/transforms/content-type-encoding-provider.d.ts +7 -0
- package/dist/src/components/transforms/content-type-encoding-provider.d.ts.map +1 -0
- package/dist/src/components/transforms/content-type-encoding-provider.js +25 -0
- package/dist/src/components/transforms/content-type-encoding-provider.js.map +1 -0
- package/dist/src/components/transforms/data-transform.d.ts +9 -0
- package/dist/src/components/transforms/data-transform.d.ts.map +1 -0
- package/dist/src/components/transforms/data-transform.js +31 -0
- package/dist/src/components/transforms/data-transform.js.map +1 -0
- package/dist/src/components/transforms/json/json-array-transform.d.ts +15 -0
- package/dist/src/components/transforms/json/json-array-transform.d.ts.map +1 -0
- package/dist/src/components/transforms/json/json-array-transform.js +71 -0
- package/dist/src/components/transforms/json/json-array-transform.js.map +1 -0
- package/dist/src/components/transforms/json/json-model-additional-properties-transform.d.ts +9 -0
- package/dist/src/components/transforms/json/json-model-additional-properties-transform.d.ts.map +1 -0
- package/dist/src/components/transforms/json/json-model-additional-properties-transform.js +35 -0
- package/dist/src/components/transforms/json/json-model-additional-properties-transform.js.map +1 -0
- package/dist/src/components/transforms/json/json-model-base-transform.d.ts +9 -0
- package/dist/src/components/transforms/json/json-model-base-transform.d.ts.map +1 -0
- package/dist/src/components/transforms/json/json-model-base-transform.js +13 -0
- package/dist/src/components/transforms/json/json-model-base-transform.js.map +1 -0
- package/dist/src/components/transforms/json/json-model-property-transform.d.ts +9 -0
- package/dist/src/components/transforms/json/json-model-property-transform.d.ts.map +1 -0
- package/dist/src/components/transforms/json/json-model-property-transform.js +44 -0
- package/dist/src/components/transforms/json/json-model-property-transform.js.map +1 -0
- package/dist/src/components/transforms/json/json-model-transform.d.ts +15 -0
- package/dist/src/components/transforms/json/json-model-transform.d.ts.map +1 -0
- package/dist/src/components/transforms/json/json-model-transform.js +96 -0
- package/dist/src/components/transforms/json/json-model-transform.js.map +1 -0
- package/dist/src/components/transforms/json/json-record-transform.d.ts +15 -0
- package/dist/src/components/transforms/json/json-record-transform.d.ts.map +1 -0
- package/dist/src/components/transforms/json/json-record-transform.js +71 -0
- package/dist/src/components/transforms/json/json-record-transform.js.map +1 -0
- package/dist/src/components/transforms/json/json-transform-discriminator.d.ts +16 -0
- package/dist/src/components/transforms/json/json-transform-discriminator.d.ts.map +1 -0
- package/dist/src/components/transforms/json/json-transform-discriminator.js +82 -0
- package/dist/src/components/transforms/json/json-transform-discriminator.js.map +1 -0
- package/dist/src/components/transforms/json/json-transform.d.ts +14 -0
- package/dist/src/components/transforms/json/json-transform.d.ts.map +1 -0
- package/dist/src/components/transforms/json/json-transform.js +149 -0
- package/dist/src/components/transforms/json/json-transform.js.map +1 -0
- package/dist/src/components/transforms/json/union-transform.d.ts +15 -0
- package/dist/src/components/transforms/json/union-transform.d.ts.map +1 -0
- package/dist/src/components/transforms/json/union-transform.js +67 -0
- package/dist/src/components/transforms/json/union-transform.js.map +1 -0
- package/dist/src/components/transforms/json/utils/transport-namer.d.ts +3 -0
- package/dist/src/components/transforms/json/utils/transport-namer.d.ts.map +1 -0
- package/dist/src/components/transforms/json/utils/transport-namer.js +13 -0
- package/dist/src/components/transforms/json/utils/transport-namer.js.map +1 -0
- package/dist/src/components/transforms/multipart/array-part-transform.d.ts +8 -0
- package/dist/src/components/transforms/multipart/array-part-transform.d.ts.map +1 -0
- package/dist/src/components/transforms/multipart/array-part-transform.js +29 -0
- package/dist/src/components/transforms/multipart/array-part-transform.js.map +1 -0
- package/dist/src/components/transforms/multipart/file-part-transform.d.ts +8 -0
- package/dist/src/components/transforms/multipart/file-part-transform.d.ts.map +1 -0
- package/dist/src/components/transforms/multipart/file-part-transform.js +40 -0
- package/dist/src/components/transforms/multipart/file-part-transform.js.map +1 -0
- package/dist/src/components/transforms/multipart/multipart-transform.d.ts +7 -0
- package/dist/src/components/transforms/multipart/multipart-transform.d.ts.map +1 -0
- package/dist/src/components/transforms/multipart/multipart-transform.js +26 -0
- package/dist/src/components/transforms/multipart/multipart-transform.js.map +1 -0
- package/dist/src/components/transforms/multipart/part-transform.d.ts +8 -0
- package/dist/src/components/transforms/multipart/part-transform.d.ts.map +1 -0
- package/dist/src/components/transforms/multipart/part-transform.js +35 -0
- package/dist/src/components/transforms/multipart/part-transform.js.map +1 -0
- package/dist/src/components/transforms/multipart/simple-part-transform.d.ts +8 -0
- package/dist/src/components/transforms/multipart/simple-part-transform.d.ts.map +1 -0
- package/dist/src/components/transforms/multipart/simple-part-transform.js +48 -0
- package/dist/src/components/transforms/multipart/simple-part-transform.js.map +1 -0
- package/dist/src/components/transforms/operation-transform-declaration.d.ts +17 -0
- package/dist/src/components/transforms/operation-transform-declaration.d.ts.map +1 -0
- package/dist/src/components/transforms/operation-transform-declaration.js +74 -0
- package/dist/src/components/transforms/operation-transform-declaration.js.map +1 -0
- package/dist/src/components/transforms/operation-transform-expression.d.ts +6 -0
- package/dist/src/components/transforms/operation-transform-expression.d.ts.map +1 -0
- package/dist/src/components/transforms/operation-transform-expression.js +60 -0
- package/dist/src/components/transforms/operation-transform-expression.js.map +1 -0
- package/dist/src/components/transforms/scalar-transform.d.ts +15 -0
- package/dist/src/components/transforms/scalar-transform.d.ts.map +1 -0
- package/dist/src/components/transforms/scalar-transform.js +317 -0
- package/dist/src/components/transforms/scalar-transform.js.map +1 -0
- package/dist/src/components/transforms/transform-name-policy.d.ts +71 -0
- package/dist/src/components/transforms/transform-name-policy.d.ts.map +1 -0
- package/dist/src/components/transforms/transform-name-policy.js +111 -0
- package/dist/src/components/transforms/transform-name-policy.js.map +1 -0
- package/dist/src/components/utils/unpack-model-property.d.ts +8 -0
- package/dist/src/components/utils/unpack-model-property.d.ts.map +1 -0
- package/dist/src/components/utils/unpack-model-property.js +33 -0
- package/dist/src/components/utils/unpack-model-property.js.map +1 -0
- package/dist/src/components/utils/url-template.d.ts +7 -0
- package/dist/src/components/utils/url-template.d.ts.map +1 -0
- package/dist/src/components/utils/url-template.js +23 -0
- package/dist/src/components/utils/url-template.js.map +1 -0
- package/dist/src/context/encoding/encoding-context.d.ts +6 -0
- package/dist/src/context/encoding/encoding-context.d.ts.map +1 -0
- package/dist/src/context/encoding/encoding-context.js +20 -0
- package/dist/src/context/encoding/encoding-context.js.map +1 -0
- package/dist/src/context/encoding/types.d.ts +6 -0
- package/dist/src/context/encoding/types.d.ts.map +1 -0
- package/dist/src/context/encoding/types.js +1 -0
- package/dist/src/context/encoding/types.js.map +1 -0
- package/dist/src/emitter.d.ts +8 -0
- package/dist/src/emitter.d.ts.map +1 -0
- package/dist/src/emitter.js +68 -0
- package/dist/src/emitter.js.map +1 -0
- package/dist/src/index.d.ts +5 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +5 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/lib.d.ts +206 -0
- package/dist/src/lib.d.ts.map +1 -0
- package/dist/src/lib.js +107 -0
- package/dist/src/lib.js.map +1 -0
- package/dist/src/testing/index.d.ts +3 -0
- package/dist/src/testing/index.d.ts.map +1 -0
- package/dist/src/testing/index.js +8 -0
- package/dist/src/testing/index.js.map +1 -0
- package/dist/src/utils/client-discovery.d.ts +7 -0
- package/dist/src/utils/client-discovery.d.ts.map +1 -0
- package/dist/src/utils/client-discovery.js +26 -0
- package/dist/src/utils/client-discovery.js.map +1 -0
- package/dist/src/utils/multipart.d.ts +3 -0
- package/dist/src/utils/multipart.d.ts.map +1 -0
- package/dist/src/utils/multipart.js +26 -0
- package/dist/src/utils/multipart.js.map +1 -0
- package/dist/src/utils/operations.d.ts +3 -0
- package/dist/src/utils/operations.d.ts.map +1 -0
- package/dist/src/utils/operations.js +11 -0
- package/dist/src/utils/operations.js.map +1 -0
- package/dist/src/utils/parameters.d.ts +14 -0
- package/dist/src/utils/parameters.d.ts.map +1 -0
- package/dist/src/utils/parameters.js +98 -0
- package/dist/src/utils/parameters.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/eng/scripts/calculate-coverage.js +36 -0
- package/eng/scripts/emit-e2e.js +329 -0
- package/eng/scripts/run-e2e-tests.js +162 -0
- package/eng/scripts/tspconfig.yaml +6 -0
- package/eng/scripts/upload-spector-results.js +120 -0
- package/package.json +83 -0
- package/src/components/client-context/client-context-declaration.tsx +19 -0
- package/src/components/client-context/client-context-factory.tsx +142 -0
- package/src/components/client-context/client-context-options.tsx +28 -0
- package/src/components/client-context/client-context.tsx +21 -0
- package/src/components/client-context/parametrized-endpoint.tsx +39 -0
- package/src/components/client-directory.tsx +40 -0
- package/src/components/client-operation.tsx +52 -0
- package/src/components/client.tsx +137 -0
- package/src/components/encoding-provider.tsx +19 -0
- package/src/components/external-packages/ts-http-runtime.ts +22 -0
- package/src/components/external-packages/uri-template.ts +11 -0
- package/src/components/http-request-options.tsx +69 -0
- package/src/components/http-request-parameters-expression.tsx +69 -0
- package/src/components/http-request.tsx +58 -0
- package/src/components/http-response.tsx +68 -0
- package/src/components/models.tsx +29 -0
- package/src/components/operation-options.tsx +26 -0
- package/src/components/operation-parameters.tsx +43 -0
- package/src/components/output.tsx +26 -0
- package/src/components/serializers.tsx +47 -0
- package/src/components/static-helpers/bytes-encoding.tsx +41 -0
- package/src/components/static-helpers/interfaces.tsx +26 -0
- package/src/components/static-helpers/multipart-helpers.tsx +59 -0
- package/src/components/static-helpers/rest-error.tsx +61 -0
- package/src/components/testing/client-options.tsx +32 -0
- package/src/components/transforms/content-type-encoding-provider.tsx +28 -0
- package/src/components/transforms/data-transform.tsx +39 -0
- package/src/components/transforms/json/json-array-transform.tsx +83 -0
- package/src/components/transforms/json/json-model-additional-properties-transform.tsx +47 -0
- package/src/components/transforms/json/json-model-base-transform.tsx +19 -0
- package/src/components/transforms/json/json-model-property-transform.tsx +41 -0
- package/src/components/transforms/json/json-model-transform.tsx +87 -0
- package/src/components/transforms/json/json-record-transform.tsx +84 -0
- package/src/components/transforms/json/json-transform-discriminator.tsx +114 -0
- package/src/components/transforms/json/json-transform.tsx +113 -0
- package/src/components/transforms/json/union-transform.tsx +73 -0
- package/src/components/transforms/json/utils/transport-namer.ts +12 -0
- package/src/components/transforms/multipart/array-part-transform.tsx +40 -0
- package/src/components/transforms/multipart/file-part-transform.tsx +44 -0
- package/src/components/transforms/multipart/multipart-transform.tsx +32 -0
- package/src/components/transforms/multipart/part-transform.tsx +22 -0
- package/src/components/transforms/multipart/simple-part-transform.tsx +49 -0
- package/src/components/transforms/operation-transform-declaration.tsx +64 -0
- package/src/components/transforms/operation-transform-expression.tsx +54 -0
- package/src/components/transforms/scalar-transform.tsx +289 -0
- package/src/components/transforms/transform-name-policy.ts +133 -0
- package/src/components/utils/unpack-model-property.ts +31 -0
- package/src/components/utils/url-template.tsx +21 -0
- package/src/context/encoding/encoding-context.tsx +26 -0
- package/src/context/encoding/types.ts +6 -0
- package/src/emitter.tsx +53 -0
- package/src/index.ts +5 -0
- package/src/lib.ts +108 -0
- package/src/testing/index.ts +8 -0
- package/src/utils/client-discovery.ts +28 -0
- package/src/utils/multipart.ts +28 -0
- package/src/utils/operations.ts +14 -0
- package/src/utils/parameters.tsx +129 -0
- 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 +38 -0
- package/test/e2e/http/authentication/oauth2/main.test.ts +41 -0
- package/test/e2e/http/authentication/union/main.test.ts +29 -0
- package/test/e2e/http/encode/bytes/main.test.ts +191 -0
- package/test/e2e/http/encode/datetime/main.test.ts +176 -0
- package/test/e2e/http/encode/duration/main.test.ts +126 -0
- package/test/e2e/http/encode/numeric/main.test.ts +26 -0
- package/test/e2e/http/parameters/basic/main.test.ts +35 -0
- package/test/e2e/http/parameters/body-optionality/main.test.ts +43 -0
- package/test/e2e/http/parameters/collection-format/main.test.ts +45 -0
- package/test/e2e/http/parameters/spread/main.test.ts +56 -0
- package/test/e2e/http/payload/content-negotiation/main.test.ts +40 -0
- package/test/e2e/http/payload/json-merge-patch/main.test.ts +122 -0
- package/test/e2e/http/payload/media-type/main.test.ts +28 -0
- package/test/e2e/http/payload/multipart/main.test.ts +164 -0
- package/test/e2e/http/payload/pageable/main.test.ts +24 -0
- package/test/e2e/http/payload/xml/main.test.ts +287 -0
- package/test/e2e/http/routes/main.test.ts +284 -0
- package/test/e2e/http/serialization/encoded-name/json/main.test.ts +20 -0
- package/test/e2e/http/server/endpoint/not-defined/main.test.ts +11 -0
- package/test/e2e/http/server/path/multiple/main.test.ts +22 -0
- package/test/e2e/http/server/path/single/main.test.ts +11 -0
- package/test/e2e/http/server/versions/not-versioned/main.test.ts +22 -0
- package/test/e2e/http/server/versions/versioned/main.test.ts +28 -0
- package/test/e2e/http/special-headers/conditional-request/main.test.ts +35 -0
- package/test/e2e/http/special-headers/repeatability/main.test.ts +18 -0
- package/test/e2e/http/special-words/main.test.ts +434 -0
- package/test/e2e/http/type/array/array.test.ts +256 -0
- package/test/e2e/http/type/dictionary/main.test.ts +229 -0
- package/test/e2e/http/type/enum/extensible/main.test.ts +34 -0
- package/test/e2e/http/type/enum/fixed/main.test.ts +29 -0
- package/test/e2e/http/type/model/empty/main.test.ts +21 -0
- package/test/e2e/http/type/model/inheritance/enum-discriminator/main.test.ts +51 -0
- package/test/e2e/http/type/model/inheritance/nested-discriminator/main.test.ts +168 -0
- package/test/e2e/http/type/model/inheritance/not-discriminated/main.test.ts +42 -0
- package/test/e2e/http/type/model/inheritance/recursive/main.test.ts +46 -0
- package/test/e2e/http/type/model/inheritance/single-discriminator/main.test.ts +101 -0
- package/test/e2e/http/type/model/visibility/main.test.ts +64 -0
- package/test/e2e/http/type/property/additional-properties/main.test.ts +185 -0
- package/test/e2e/http/type/property/additional-properties/spreads.test.ts +470 -0
- package/test/e2e/http/type/property/nullable/main.test.ts +275 -0
- package/test/e2e/http/type/property/optionality/main.test.ts +256 -0
- package/test/e2e/http/type/property/value-types/main.test.ts +193 -0
- package/test/e2e/http/type/scalar/main.test.ts +133 -0
- package/test/e2e/http/type/scalar/scalar.test.ts +95 -0
- package/test/e2e/http/type/union/main.test.ts +207 -0
- package/test/e2e/http/versioning/added/main.test.ts +61 -0
- package/test/e2e/http/versioning/madeOptional/main.test.ts +34 -0
- package/test/e2e/http/versioning/removed/main.test.ts +75 -0
- package/test/e2e/http/versioning/renamedFrom/main.test.ts +52 -0
- package/test/e2e/http/versioning/returnTypeChangedFrom/main.test.ts +22 -0
- package/test/e2e/http/versioning/typeChangedFrom/main.test.ts +31 -0
- package/test/scenarios/additional-properties/extends.md +71 -0
- package/test/scenarios/additional-properties/is.md +46 -0
- package/test/scenarios/additional-properties/spread.md +72 -0
- package/test/scenarios/auth/basic_auth.md +67 -0
- package/test/scenarios/auth/bearer.md +67 -0
- package/test/scenarios/auth/client_parameters.md +68 -0
- package/test/scenarios/auth/client_structure.md +38 -0
- package/test/scenarios/auth/key_credential.md +67 -0
- package/test/scenarios/auth/sub_client_override.md +114 -0
- package/test/scenarios/client/client_context.md +36 -0
- package/test/scenarios/client/dotted_namespace.md +30 -0
- package/test/scenarios/client/global_namespace.md +74 -0
- package/test/scenarios/client/multiple_top_level_clients.md +74 -0
- package/test/scenarios/client/nested_client.md +106 -0
- package/test/scenarios/client/wrapping_namespace.md +43 -0
- package/test/scenarios/encoding/bytes_body.md +48 -0
- package/test/scenarios/encoding/bytes_json_property.md +60 -0
- package/test/scenarios/encoding/bytes_nullable.md +153 -0
- package/test/scenarios/encoding/header_bytes.md +142 -0
- package/test/scenarios/encoding/header_date.md +236 -0
- package/test/scenarios/encoding/model_with_bytes_property.md +50 -0
- package/test/scenarios/encoding/query_bytes.md +46 -0
- package/test/scenarios/encoding/query_date.md +236 -0
- package/test/scenarios/http-operations/basic-request.md +162 -0
- package/test/scenarios/http-operations/basic-response.md +246 -0
- package/test/scenarios/http-operations/basic.md +134 -0
- package/test/scenarios/http-operations/constant-header.md +37 -0
- package/test/scenarios/http-operations/create-operation.md +62 -0
- package/test/scenarios/http-operations/on_response.md +56 -0
- package/test/scenarios/http-operations/optional-request-body.md +55 -0
- package/test/scenarios/http-operations/path-parameter-in-model.md +59 -0
- package/test/scenarios/http-operations/path-parameter.md +54 -0
- package/test/scenarios/http-operations/scalar-payload.md +63 -0
- package/test/scenarios/http-operations/with-parameters.md +85 -0
- package/test/scenarios/models/array-properties.md +47 -0
- package/test/scenarios/models/basic.md +118 -0
- package/test/scenarios/models/dictionary-properties.md +44 -0
- package/test/scenarios/models/inheritance_2_discriminators.md +370 -0
- package/test/scenarios/models/inheritance_discriminator.md +92 -0
- package/test/scenarios/models/inline-models.md +29 -0
- package/test/scenarios/models/model_additional_properties.md +79 -0
- package/test/scenarios/models/model_extends.md +101 -0
- package/test/scenarios/models/model_spread.md +65 -0
- package/test/scenarios/models/nested_property.md +45 -0
- package/test/scenarios/models/property_references_property.md +156 -0
- package/test/scenarios/multipart/anonymous_part.md +57 -0
- package/test/scenarios/multipart/file.md +166 -0
- package/test/scenarios/multipart/file_content_type.md +67 -0
- package/test/scenarios/multipart/simple_part.md +69 -0
- package/test/scenarios/operation-parameters/body_root_anonymous.md +92 -0
- package/test/scenarios/operation-parameters/constant_as_optional.md +59 -0
- package/test/scenarios/operation-parameters/default_value_as_optional.md +59 -0
- package/test/scenarios/operation-parameters/no_content_type.md +67 -0
- package/test/scenarios/operation-parameters/no_parameters.md +55 -0
- package/test/scenarios/operation-parameters/only_optional.md +67 -0
- package/test/scenarios/operation-parameters/only_required.md +63 -0
- package/test/scenarios/operation-parameters/reserved_names.md +65 -0
- package/test/scenarios/operation-parameters/spread_body.md +75 -0
- package/test/scenarios/operation-parameters/spread_with_nested.md +87 -0
- package/test/scenarios/operation-parameters/union_body.md +92 -0
- package/test/scenarios/operation-parameters/with_body_property.md +72 -0
- package/test/scenarios/operation-parameters/with_body_root.md +74 -0
- package/test/scenarios/serializers/arrays.md +199 -0
- package/test/scenarios/serializers/basic_model.md +115 -0
- package/test/scenarios/serializers/basic_model_wire_name.md +50 -0
- package/test/scenarios/serializers/discriminated_union.md +86 -0
- package/test/scenarios/serializers/discriminated_union_spread.md +119 -0
- package/test/scenarios/serializers/model_date_time.md +65 -0
- package/test/scenarios/serializers/multipart.md +66 -0
- package/test/scenarios/serializers/polymorphic_single_level_inheritance.md +164 -0
- package/test/scenarios/serializers/record.md +101 -0
- package/test/scenarios/serializers/scalars.md +33 -0
- package/test/scenarios/serializers/spread.md +75 -0
- package/test/scenarios/serializers/string_union.md +61 -0
- package/test/scenarios/server/default_url.md +45 -0
- package/test/scenarios/server/multiple-parameters.md +57 -0
- package/test/scenarios/server/no-server.md +37 -0
- package/test/scenarios/server/parametrized-endpoint.md +53 -0
- package/test/scenarios.test.ts +18 -0
- package/test/test-host.ts +76 -0
- package/tsconfig.json +16 -0
- package/tsconfig.test.json +7 -0
- package/vitest.config.js +23 -0
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { NestedDiscriminatorClient } from "../../../../../generated/type/model/inheritance/nested-discriminator/src/index.js";
|
|
3
|
+
|
|
4
|
+
describe("Type.Model.Inheritance.NestedDiscriminator", () => {
|
|
5
|
+
const client = new NestedDiscriminatorClient({
|
|
6
|
+
allowInsecureConnection: true,
|
|
7
|
+
retryOptions: {
|
|
8
|
+
maxRetries: 0,
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it("should get a polymorphic model with 2 discriminators", async () => {
|
|
13
|
+
const response = await client.getModel();
|
|
14
|
+
expect(response).toEqual({
|
|
15
|
+
age: 1,
|
|
16
|
+
kind: "shark",
|
|
17
|
+
sharktype: "goblin",
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it("should send a polymorphic model with 2 discriminators", async () => {
|
|
22
|
+
const input = {
|
|
23
|
+
age: 1,
|
|
24
|
+
kind: "shark",
|
|
25
|
+
sharktype: "goblin",
|
|
26
|
+
};
|
|
27
|
+
await client.putModel(input);
|
|
28
|
+
// Assert successful request
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it("should get a recursive polymorphic model", async () => {
|
|
32
|
+
const response = await client.getRecursiveModel();
|
|
33
|
+
expect(response).toEqual({
|
|
34
|
+
age: 1,
|
|
35
|
+
kind: "salmon",
|
|
36
|
+
partner: {
|
|
37
|
+
age: 2,
|
|
38
|
+
kind: "shark",
|
|
39
|
+
sharktype: "saw",
|
|
40
|
+
},
|
|
41
|
+
friends: [
|
|
42
|
+
{
|
|
43
|
+
age: 2,
|
|
44
|
+
kind: "salmon",
|
|
45
|
+
partner: {
|
|
46
|
+
age: 3,
|
|
47
|
+
kind: "salmon",
|
|
48
|
+
},
|
|
49
|
+
hate: {
|
|
50
|
+
key1: {
|
|
51
|
+
age: 4,
|
|
52
|
+
kind: "salmon",
|
|
53
|
+
},
|
|
54
|
+
key2: {
|
|
55
|
+
age: 2,
|
|
56
|
+
kind: "shark",
|
|
57
|
+
sharktype: "goblin",
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
age: 3,
|
|
63
|
+
kind: "shark",
|
|
64
|
+
sharktype: "goblin",
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
hate: {
|
|
68
|
+
key3: {
|
|
69
|
+
age: 3,
|
|
70
|
+
kind: "shark",
|
|
71
|
+
sharktype: "saw",
|
|
72
|
+
},
|
|
73
|
+
key4: {
|
|
74
|
+
age: 2,
|
|
75
|
+
kind: "salmon",
|
|
76
|
+
friends: [
|
|
77
|
+
{
|
|
78
|
+
age: 1,
|
|
79
|
+
kind: "salmon",
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
age: 4,
|
|
83
|
+
kind: "shark",
|
|
84
|
+
sharktype: "goblin",
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
it("should send a recursive polymorphic model", async () => {
|
|
93
|
+
const input = {
|
|
94
|
+
age: 1,
|
|
95
|
+
kind: "salmon",
|
|
96
|
+
partner: {
|
|
97
|
+
age: 2,
|
|
98
|
+
kind: "shark",
|
|
99
|
+
sharktype: "saw",
|
|
100
|
+
},
|
|
101
|
+
friends: [
|
|
102
|
+
{
|
|
103
|
+
age: 2,
|
|
104
|
+
kind: "salmon",
|
|
105
|
+
partner: {
|
|
106
|
+
age: 3,
|
|
107
|
+
kind: "salmon",
|
|
108
|
+
},
|
|
109
|
+
hate: {
|
|
110
|
+
key1: {
|
|
111
|
+
age: 4,
|
|
112
|
+
kind: "salmon",
|
|
113
|
+
},
|
|
114
|
+
key2: {
|
|
115
|
+
age: 2,
|
|
116
|
+
kind: "shark",
|
|
117
|
+
sharktype: "goblin",
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
age: 3,
|
|
123
|
+
kind: "shark",
|
|
124
|
+
sharktype: "goblin",
|
|
125
|
+
},
|
|
126
|
+
],
|
|
127
|
+
hate: {
|
|
128
|
+
key3: {
|
|
129
|
+
age: 3,
|
|
130
|
+
kind: "shark",
|
|
131
|
+
sharktype: "saw",
|
|
132
|
+
},
|
|
133
|
+
key4: {
|
|
134
|
+
age: 2,
|
|
135
|
+
kind: "salmon",
|
|
136
|
+
friends: [
|
|
137
|
+
{
|
|
138
|
+
age: 1,
|
|
139
|
+
kind: "salmon",
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
age: 4,
|
|
143
|
+
kind: "shark",
|
|
144
|
+
sharktype: "goblin",
|
|
145
|
+
},
|
|
146
|
+
],
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
};
|
|
150
|
+
await client.putRecursiveModel(input);
|
|
151
|
+
// Assert successful request
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
it("should get a model omitting the discriminator", async () => {
|
|
155
|
+
const response = await client.getMissingDiscriminator();
|
|
156
|
+
expect(response).toEqual({
|
|
157
|
+
age: 1,
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
it("should get a model with a wrong discriminator value", async () => {
|
|
162
|
+
const response = await client.getWrongDiscriminator();
|
|
163
|
+
expect(response).toEqual({
|
|
164
|
+
age: 1,
|
|
165
|
+
kind: "wrongKind",
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { NotDiscriminatedClient } from "../../../../../generated/type/model/inheritance/not-discriminated/src/index.js";
|
|
3
|
+
|
|
4
|
+
describe("Type.Model.Inheritance.NotDiscriminated", () => {
|
|
5
|
+
const client = new NotDiscriminatedClient({
|
|
6
|
+
allowInsecureConnection: true,
|
|
7
|
+
retryOptions: {
|
|
8
|
+
maxRetries: 0,
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it("should generate and send model", async () => {
|
|
13
|
+
await client.postValid({
|
|
14
|
+
name: "abc",
|
|
15
|
+
age: 32,
|
|
16
|
+
smart: true,
|
|
17
|
+
});
|
|
18
|
+
// Assert successful request
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it("should generate and receive model", async () => {
|
|
22
|
+
const response = await client.getValid();
|
|
23
|
+
expect(response).toEqual({
|
|
24
|
+
name: "abc",
|
|
25
|
+
age: 32,
|
|
26
|
+
smart: true,
|
|
27
|
+
}); // Mock API expected value
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it("should generate, send, and receive round-trip bottom model", async () => {
|
|
31
|
+
const response = await client.putValid({
|
|
32
|
+
name: "abc",
|
|
33
|
+
age: 32,
|
|
34
|
+
smart: true,
|
|
35
|
+
});
|
|
36
|
+
expect(response).toEqual({
|
|
37
|
+
name: "abc",
|
|
38
|
+
age: 32,
|
|
39
|
+
smart: true,
|
|
40
|
+
}); // Mock API expected value
|
|
41
|
+
});
|
|
42
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { RecursiveClient } from "../../../../../generated/type/model/inheritance/recursive/src/index.js";
|
|
3
|
+
|
|
4
|
+
describe("Type.Model.Inheritance.Recursive", () => {
|
|
5
|
+
const client = new RecursiveClient({ allowInsecureConnection: true });
|
|
6
|
+
|
|
7
|
+
it("should send a PUT request with a recursive Extension model", async () => {
|
|
8
|
+
await client.put({
|
|
9
|
+
level: 0,
|
|
10
|
+
extension: [
|
|
11
|
+
{
|
|
12
|
+
level: 1,
|
|
13
|
+
extension: [
|
|
14
|
+
{
|
|
15
|
+
level: 2,
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
level: 1,
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
});
|
|
24
|
+
// Assert successful request
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it("should handle a GET request returning a recursive Extension model", async () => {
|
|
28
|
+
const response = await client.get();
|
|
29
|
+
expect(response).toEqual({
|
|
30
|
+
level: 0,
|
|
31
|
+
extension: [
|
|
32
|
+
{
|
|
33
|
+
level: 1,
|
|
34
|
+
extension: [
|
|
35
|
+
{
|
|
36
|
+
level: 2,
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
level: 1,
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
}); // Mock API expected value
|
|
45
|
+
});
|
|
46
|
+
});
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import {
|
|
3
|
+
Eagle,
|
|
4
|
+
SingleDiscriminatorClient,
|
|
5
|
+
} from "../../../../../generated/type/model/inheritance/single-discriminator/src/index.js";
|
|
6
|
+
|
|
7
|
+
describe("Type.Model.Inheritance.SingleDiscriminator", () => {
|
|
8
|
+
const client = new SingleDiscriminatorClient({
|
|
9
|
+
allowInsecureConnection: true,
|
|
10
|
+
retryOptions: {
|
|
11
|
+
maxRetries: 0,
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it("should receive polymorphic model in single level inheritance with 1 discriminator", async () => {
|
|
16
|
+
const response = await client.getModel();
|
|
17
|
+
expect(response).toEqual({
|
|
18
|
+
wingspan: 1,
|
|
19
|
+
kind: "sparrow",
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it("should send polymorphic model in single level inheritance with 1 discriminator", async () => {
|
|
24
|
+
await client.putModel({
|
|
25
|
+
wingspan: 1,
|
|
26
|
+
kind: "sparrow",
|
|
27
|
+
});
|
|
28
|
+
// Assert successful request
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it("should receive polymorphic models with collection and dictionary properties referring to other polymorphic models", async () => {
|
|
32
|
+
const response = await client.getRecursiveModel();
|
|
33
|
+
expect(response).toEqual({
|
|
34
|
+
wingspan: 5,
|
|
35
|
+
kind: "eagle",
|
|
36
|
+
partner: {
|
|
37
|
+
wingspan: 2,
|
|
38
|
+
kind: "goose",
|
|
39
|
+
},
|
|
40
|
+
friends: [
|
|
41
|
+
{
|
|
42
|
+
wingspan: 2,
|
|
43
|
+
kind: "seagull",
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
hate: {
|
|
47
|
+
key3: {
|
|
48
|
+
wingspan: 1,
|
|
49
|
+
kind: "sparrow",
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it("should send polymorphic models with collection and dictionary properties referring to other polymorphic models", async () => {
|
|
56
|
+
await client.putRecursiveModel({
|
|
57
|
+
wingspan: 5,
|
|
58
|
+
kind: "eagle",
|
|
59
|
+
partner: {
|
|
60
|
+
wingspan: 2,
|
|
61
|
+
kind: "goose",
|
|
62
|
+
},
|
|
63
|
+
friends: [
|
|
64
|
+
{
|
|
65
|
+
wingspan: 2,
|
|
66
|
+
kind: "seagull",
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
hate: {
|
|
70
|
+
key3: {
|
|
71
|
+
wingspan: 1,
|
|
72
|
+
kind: "sparrow",
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
} as Eagle);
|
|
76
|
+
// Assert successful request
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it("should handle a model omitting the discriminator", async () => {
|
|
80
|
+
const response = await client.getMissingDiscriminator();
|
|
81
|
+
expect(response).toEqual({
|
|
82
|
+
wingspan: 1,
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
it("should handle a model containing a discriminator value that was never defined", async () => {
|
|
87
|
+
const response = await client.getWrongDiscriminator();
|
|
88
|
+
expect(response).toEqual({
|
|
89
|
+
wingspan: 1,
|
|
90
|
+
kind: "wrongKind",
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
it("should receive polymorphic model defined in a legacy way", async () => {
|
|
95
|
+
const response = await client.getLegacyModel();
|
|
96
|
+
expect(response).toEqual({
|
|
97
|
+
size: 20,
|
|
98
|
+
kind: "t-rex",
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
});
|
|
@@ -0,0 +1,64 @@
|
|
|
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("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("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
|
+
});
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import {
|
|
3
|
+
ExtendsUnknownAdditionalPropertiesDiscriminatedDerived,
|
|
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
|
+
});
|