From 841650a05bf0b4e74ccf81d3b92d750299e12a81 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Tue, 23 May 2023 00:13:42 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc 0.0.1, Speakeay CLI 1.37.5 --- RELEASES.md | 10 +- go-client-sdk/README.md | 2 +- go-client-sdk/auth.go | 62 +++- go-client-sdk/authnew.go | 82 ++++- go-client-sdk/docs/generation/README.md | 4 +- go-client-sdk/errors.go | 26 +- go-client-sdk/flattening.go | 52 ++- go-client-sdk/gen.yaml | 6 +- go-client-sdk/generation.go | 90 ++++- go-client-sdk/globals.go | 22 +- go-client-sdk/parameters.go | 192 ++++++++--- .../operations/deprecatedwithcommentsget.go | 2 +- go-client-sdk/requestbodies.go | 312 ++++++++++++++---- go-client-sdk/responsebodies.go | 46 +-- go-client-sdk/sdk.go | 26 +- go-client-sdk/servers.go | 34 +- go-client-sdk/telemetry.go | 22 +- go-client-sdk/tests/responsebodies_test.go | 5 + go-client-sdk/tests/telemetry_test.go | 4 +- go-client-sdk/unions.go | 52 ++- java-client-sdk/README.md | 4 +- java-client-sdk/docs/generation/README.md | 4 +- java-client-sdk/gen.yaml | 6 +- java-client-sdk/lib/build.gradle | 2 +- .../java/org/openapis/openapi/Generation.java | 6 +- .../main/java/org/openapis/openapi/SDK.java | 4 +- .../DeprecatedWithCommentsGetRequest.java | 2 +- .../openapis/openapi/ResponseBodiesTests.java | 5 + .../org/openapis/openapi/TelemetryTests.java | 4 +- php-client-sdk/README.md | 2 +- php-client-sdk/docs/generation/README.md | 4 +- php-client-sdk/gen.yaml | 6 +- php-client-sdk/src/Generation.php | 2 +- .../DeprecatedWithCommentsGetRequest.php | 2 +- php-client-sdk/src/SDK.php | 4 +- php-client-sdk/tests/ResponseBodiesTest.php | 2 + php-client-sdk/tests/TelemetryTest.php | 4 +- python-client-sdk/README.md | 2 +- python-client-sdk/docs/generation/README.md | 4 +- python-client-sdk/gen.yaml | 6 +- python-client-sdk/setup.py | 2 +- python-client-sdk/src/sdk/generation.py | 2 +- .../operations/deprecatedwithcommentsget.py | 2 +- python-client-sdk/src/sdk/sdk.py | 4 +- .../tests/test_response_bodies.py | 1 + python-client-sdk/tests/test_telemetry.py | 4 +- ruby-client-sdk/README.md | 2 +- ruby-client-sdk/docs/generation/README.md | 4 +- ruby-client-sdk/gen.yaml | 6 +- ruby-client-sdk/lib/sdk/generation.rb | 2 +- .../operations/deprecatedwithcommentsget.rb | 2 +- ruby-client-sdk/lib/sdk/sdk.rb | 4 +- ruby-client-sdk/openapi.gemspec | 2 +- ruby-client-sdk/test/responsebodies_test.rb | 1 + ruby-client-sdk/test/telemetry_test.rb | 4 +- typescript-client-sdk/README.md | 2 +- .../__tests__/responsebodies.test.ts | 3 + .../__tests__/telemetry.test.ts | 4 +- .../docs/generation/README.md | 4 +- typescript-client-sdk/gen.yaml | 6 +- typescript-client-sdk/package-lock.json | 4 +- typescript-client-sdk/package.json | 2 +- typescript-client-sdk/src/sdk/generation.ts | 2 +- .../operations/deprecatedwithcommentsget.ts | 2 +- typescript-client-sdk/src/sdk/sdk.ts | 4 +- 65 files changed, 921 insertions(+), 280 deletions(-) diff --git a/RELEASES.md b/RELEASES.md index b32b6b36b..8a9407c6b 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -62,4 +62,12 @@ Based on: - OpenAPI Doc 0.0.1 - Speakeasy CLI 1.36.3 (2.31.0) https://github.com/speakeasy-api/speakeasy ### Releases -- [Go v1.2.1] https://github.com/speakeasy-api/openapi-generation-tests/releases/tag/go-client-sdk/v1.2.1 - go-client-sdk \ No newline at end of file +- [Go v1.2.1] https://github.com/speakeasy-api/openapi-generation-tests/releases/tag/go-client-sdk/v1.2.1 - go-client-sdk + +## 2023-05-23 00:11:54 +### Changes +Based on: +- OpenAPI Doc 0.0.1 +- Speakeasy CLI 1.37.5 (2.32.2) https://github.com/speakeasy-api/speakeasy +### Releases +- [Go v1.3.0] https://github.com/speakeasy-api/openapi-generation-tests/releases/tag/go-client-sdk/v1.3.0 - go-client-sdk \ No newline at end of file diff --git a/go-client-sdk/README.md b/go-client-sdk/README.md index 495f35992..391edab00 100755 --- a/go-client-sdk/README.md +++ b/go-client-sdk/README.md @@ -137,7 +137,7 @@ func main() { * [AnchorTypesGet](docs/generation/README.md#anchortypesget) * [CircularReferenceGet](docs/generation/README.md#circularreferenceget) * [~~DeprecatedNoCommentsGet~~](docs/generation/README.md#deprecatednocommentsget) - :warning: **Deprecated** -* [~~DeprecatedWithCommentsGet~~](docs/generation/README.md#deprecatedwithcommentsget) - This is an endpoint setup to test deprecation with comments :warning: **Deprecated** +* [~~DeprecatedWithCommentsGet~~](docs/generation/README.md#deprecatedwithcommentsget) - This is an endpoint setup to test deprecation with comments :warning: **Deprecated** - Use `SimplePathParameterObjects` instead. * [GlobalNameOverridden](docs/generation/README.md#globalnameoverridden) * [IgnoredGenerationGet](docs/generation/README.md#ignoredgenerationget) * [IgnoresPost](docs/generation/README.md#ignorespost) diff --git a/go-client-sdk/auth.go b/go-client-sdk/auth.go index 1154da5e4..0e7b59f77 100755 --- a/go-client-sdk/auth.go +++ b/go-client-sdk/auth.go @@ -3,8 +3,10 @@ package sdk import ( + "bytes" "context" "fmt" + "io" "net/http" "openapi/pkg/models/operations" "openapi/pkg/utils" @@ -54,7 +56,13 @@ func (s *auth) APIKeyAuth(ctx context.Context, security operations.APIKeyAuthSec if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -68,7 +76,7 @@ func (s *auth) APIKeyAuth(ctx context.Context, security operations.APIKeyAuthSec switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.APIKeyAuthToken - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -100,7 +108,13 @@ func (s *auth) APIKeyAuthGlobal(ctx context.Context) (*operations.APIKeyAuthGlob if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -114,7 +128,7 @@ func (s *auth) APIKeyAuthGlobal(ctx context.Context) (*operations.APIKeyAuthGlob switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.APIKeyAuthGlobalToken - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -154,7 +168,13 @@ func (s *auth) BasicAuth(ctx context.Context, security operations.BasicAuthSecur if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -168,7 +188,7 @@ func (s *auth) BasicAuth(ctx context.Context, security operations.BasicAuthSecur switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.BasicAuthUser - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -200,7 +220,13 @@ func (s *auth) BearerAuth(ctx context.Context, security operations.BearerAuthSec if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -214,7 +240,7 @@ func (s *auth) BearerAuth(ctx context.Context, security operations.BearerAuthSec switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.BearerAuthToken - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -246,7 +272,13 @@ func (s *auth) Oauth2Auth(ctx context.Context, security operations.Oauth2AuthSec if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -260,7 +292,7 @@ func (s *auth) Oauth2Auth(ctx context.Context, security operations.Oauth2AuthSec switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.Oauth2AuthToken - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -292,7 +324,13 @@ func (s *auth) OpenIDConnectAuth(ctx context.Context, security operations.OpenID if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -306,7 +344,7 @@ func (s *auth) OpenIDConnectAuth(ctx context.Context, security operations.OpenID switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.OpenIDConnectAuthToken - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } diff --git a/go-client-sdk/authnew.go b/go-client-sdk/authnew.go index 810dcefc5..2559a6731 100755 --- a/go-client-sdk/authnew.go +++ b/go-client-sdk/authnew.go @@ -3,8 +3,10 @@ package sdk import ( + "bytes" "context" "fmt" + "io" "net/http" "openapi/pkg/models/operations" "openapi/pkg/models/shared" @@ -76,7 +78,13 @@ func (s *authNew) APIKeyAuthGlobalNew(ctx context.Context, request shared.AuthSe if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -135,7 +143,13 @@ func (s *authNew) BasicAuthNew(ctx context.Context, request shared.AuthServiceRe if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -194,7 +208,13 @@ func (s *authNew) MultipleMixedOptionsAuth(ctx context.Context, request shared.A if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -253,7 +273,13 @@ func (s *authNew) MultipleMixedSchemeAuth(ctx context.Context, request shared.Au if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -312,7 +338,13 @@ func (s *authNew) MultipleOptionsWithMixedSchemesAuth(ctx context.Context, reque if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -371,7 +403,13 @@ func (s *authNew) MultipleOptionsWithSimpleSchemesAuth(ctx context.Context, requ if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -430,7 +468,13 @@ func (s *authNew) MultipleSimpleOptionsAuth(ctx context.Context, request shared. if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -489,7 +533,13 @@ func (s *authNew) MultipleSimpleSchemeAuth(ctx context.Context, request shared.A if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -548,7 +598,13 @@ func (s *authNew) Oauth2AuthNew(ctx context.Context, request shared.AuthServiceR if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -607,7 +663,13 @@ func (s *authNew) OpenIDConnectAuthNew(ctx context.Context, request shared.AuthS if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") diff --git a/go-client-sdk/docs/generation/README.md b/go-client-sdk/docs/generation/README.md index 0d2cf2517..8bb0a9b72 100755 --- a/go-client-sdk/docs/generation/README.md +++ b/go-client-sdk/docs/generation/README.md @@ -9,7 +9,7 @@ Endpoints for purely testing valid generation behavior. * [AnchorTypesGet](#anchortypesget) * [CircularReferenceGet](#circularreferenceget) * [~~DeprecatedNoCommentsGet~~](#deprecatednocommentsget) - :warning: **Deprecated** -* [~~DeprecatedWithCommentsGet~~](#deprecatedwithcommentsget) - This is an endpoint setup to test deprecation with comments :warning: **Deprecated** +* [~~DeprecatedWithCommentsGet~~](#deprecatedwithcommentsget) - This is an endpoint setup to test deprecation with comments :warning: **Deprecated** - Use `SimplePathParameterObjects` instead. * [GlobalNameOverridden](#globalnameoverridden) * [IgnoredGenerationGet](#ignoredgenerationget) * [IgnoresPost](#ignorespost) @@ -125,7 +125,7 @@ func main() { This is an endpoint setup to test deprecation with comments -> :warning: **DEPRECATED**: this method will be removed in a future release, please migrate away from it as soon as possible. +> :warning: **DEPRECATED**: this method will be removed in a future release, please migrate away from it as soon as possible. Use `SimplePathParameterObjects` instead. ### Example Usage diff --git a/go-client-sdk/errors.go b/go-client-sdk/errors.go index f913af715..9254b9f54 100755 --- a/go-client-sdk/errors.go +++ b/go-client-sdk/errors.go @@ -3,8 +3,10 @@ package sdk import ( + "bytes" "context" "fmt" + "io" "net/http" "openapi/pkg/models/operations" "openapi/pkg/models/shared" @@ -69,7 +71,13 @@ func (s *errors) ConnectionErrorGet(ctx context.Context, opts ...operations.Opti if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -112,7 +120,13 @@ func (s *errors) StatusGet(ctx context.Context, statusCode int64) (*operations.S if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -201,7 +215,13 @@ func (s *errors) StatusPostRetries(ctx context.Context, statusCode int64, simple if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") diff --git a/go-client-sdk/flattening.go b/go-client-sdk/flattening.go index 8b00dcd19..0910bc2ee 100755 --- a/go-client-sdk/flattening.go +++ b/go-client-sdk/flattening.go @@ -3,8 +3,10 @@ package sdk import ( + "bytes" "context" "fmt" + "io" "net/http" "openapi/pkg/models/operations" "openapi/pkg/models/shared" @@ -74,7 +76,13 @@ func (s *flattening) ComponentBodyAndParamConflict(ctx context.Context, simpleOb if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -88,7 +96,7 @@ func (s *flattening) ComponentBodyAndParamConflict(ctx context.Context, simpleOb switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.ComponentBodyAndParamConflictRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -138,7 +146,13 @@ func (s *flattening) ComponentBodyAndParamNoConflict(ctx context.Context, paramS if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -152,7 +166,7 @@ func (s *flattening) ComponentBodyAndParamNoConflict(ctx context.Context, paramS switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.ComponentBodyAndParamNoConflictRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -195,7 +209,13 @@ func (s *flattening) ConflictingParams(ctx context.Context, strPathParameter str if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -209,7 +229,7 @@ func (s *flattening) ConflictingParams(ctx context.Context, strPathParameter str switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.ConflictingParamsRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -259,7 +279,13 @@ func (s *flattening) InlineBodyAndParamConflict(ctx context.Context, requestBody if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -273,7 +299,7 @@ func (s *flattening) InlineBodyAndParamConflict(ctx context.Context, requestBody switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.InlineBodyAndParamConflictRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -323,7 +349,13 @@ func (s *flattening) InlineBodyAndParamNoConflict(ctx context.Context, requestBo if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -337,7 +369,7 @@ func (s *flattening) InlineBodyAndParamNoConflict(ctx context.Context, requestBo switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.InlineBodyAndParamNoConflictRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } diff --git a/go-client-sdk/gen.yaml b/go-client-sdk/gen.yaml index 7743bdec4..53d56a0d4 100755 --- a/go-client-sdk/gen.yaml +++ b/go-client-sdk/gen.yaml @@ -2,12 +2,12 @@ configVersion: 1.0.0 management: docChecksum: 76623f721a416be989cb70240cd8b7e1 docVersion: 0.0.1 - speakeasyVersion: 1.36.3 - generationVersion: 2.31.0 + speakeasyVersion: 1.37.5 + generationVersion: 2.32.2 generation: sdkClassName: SDK singleTagPerOp: false go: - version: 1.2.1 + version: 1.3.0 maxMethodParams: 5 packageName: openapi diff --git a/go-client-sdk/generation.go b/go-client-sdk/generation.go index 723cb2766..9c317bfe4 100755 --- a/go-client-sdk/generation.go +++ b/go-client-sdk/generation.go @@ -3,8 +3,10 @@ package sdk import ( + "bytes" "context" "fmt" + "io" "net/http" "openapi/pkg/models/operations" "openapi/pkg/models/shared" @@ -55,7 +57,13 @@ func (s *generation) AnchorTypesGet(ctx context.Context) (*operations.AnchorType if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -69,7 +77,7 @@ func (s *generation) AnchorTypesGet(ctx context.Context) (*operations.AnchorType switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.TypeFromAnchor - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -100,7 +108,13 @@ func (s *generation) CircularReferenceGet(ctx context.Context) (*operations.Circ if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -114,7 +128,7 @@ func (s *generation) CircularReferenceGet(ctx context.Context) (*operations.Circ switch { case utils.MatchContentType(contentType, `application/json`): var out *shared.ValidCircularReferenceObject - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -156,7 +170,13 @@ func (s *generation) DeprecatedNoCommentsGet(ctx context.Context, deprecatedPara if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -174,7 +194,7 @@ func (s *generation) DeprecatedNoCommentsGet(ctx context.Context, deprecatedPara // DeprecatedWithCommentsGet - This is an endpoint setup to test deprecation with comments // -// Deprecated: this method will be removed in a future release, please migrate away from it as soon as possible. +// Deprecated: this method will be removed in a future release, please migrate away from it as soon as possible. Use SimplePathParameterObjects instead. func (s *generation) DeprecatedWithCommentsGet(ctx context.Context, deprecatedParameter *string, newParameter *string) (*operations.DeprecatedWithCommentsGetResponse, error) { request := operations.DeprecatedWithCommentsGetRequest{ DeprecatedParameter: deprecatedParameter, @@ -204,7 +224,13 @@ func (s *generation) DeprecatedWithCommentsGet(ctx context.Context, deprecatedPa if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -240,7 +266,13 @@ func (s *generation) GlobalNameOverridden(ctx context.Context) (*operations.GetG if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -254,7 +286,7 @@ func (s *generation) GlobalNameOverridden(ctx context.Context) (*operations.GetG switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.GetGlobalNameOverride200ApplicationJSON - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -285,7 +317,13 @@ func (s *generation) IgnoredGenerationGet(ctx context.Context) (*operations.Igno if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -299,7 +337,7 @@ func (s *generation) IgnoredGenerationGet(ctx context.Context) (*operations.Igno switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.IgnoredGenerationGet200ApplicationJSON - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -346,7 +384,13 @@ func (s *generation) IgnoresPost(ctx context.Context, requestBody *operations.Ig if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -360,7 +404,7 @@ func (s *generation) IgnoresPost(ctx context.Context, requestBody *operations.Ig switch { case utils.MatchContentType(contentType, `application/json`): var out *shared.HTTPBinSimpleJSONObject - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -399,7 +443,13 @@ func (s *generation) NameOverride(ctx context.Context, testQueryParam string) (* if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -413,7 +463,7 @@ func (s *generation) NameOverride(ctx context.Context, testQueryParam string) (* switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.OverridenResponse - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -458,7 +508,13 @@ func (s *generation) UsageExamplePost(ctx context.Context, request operations.Us if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -472,7 +528,7 @@ func (s *generation) UsageExamplePost(ctx context.Context, request operations.Us switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.UsageExamplePost200ApplicationJSON - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } diff --git a/go-client-sdk/globals.go b/go-client-sdk/globals.go index ccd9bf116..c4384e8f6 100755 --- a/go-client-sdk/globals.go +++ b/go-client-sdk/globals.go @@ -3,8 +3,10 @@ package sdk import ( + "bytes" "context" "fmt" + "io" "net/http" "openapi/pkg/models/operations" "openapi/pkg/utils" @@ -61,7 +63,13 @@ func (s *globals) GlobalPathParameterGet(ctx context.Context, globalPathParam *i if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -75,7 +83,7 @@ func (s *globals) GlobalPathParameterGet(ctx context.Context, globalPathParam *i switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.GlobalPathParameterGetRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -114,7 +122,13 @@ func (s *globals) GlobalsQueryParameterGet(ctx context.Context, globalQueryParam if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -128,7 +142,7 @@ func (s *globals) GlobalsQueryParameterGet(ctx context.Context, globalQueryParam switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.GlobalsQueryParameterGetRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } diff --git a/go-client-sdk/parameters.go b/go-client-sdk/parameters.go index f8e18f67f..a68e7c715 100755 --- a/go-client-sdk/parameters.go +++ b/go-client-sdk/parameters.go @@ -3,8 +3,10 @@ package sdk import ( + "bytes" "context" "fmt" + "io" "net/http" "openapi/pkg/models/operations" "openapi/pkg/models/shared" @@ -64,7 +66,13 @@ func (s *parameters) DeepObjectQueryParamsMap(ctx context.Context, mapParam map[ if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -78,7 +86,7 @@ func (s *parameters) DeepObjectQueryParamsMap(ctx context.Context, mapParam map[ switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.DeepObjectQueryParamsMapRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -118,7 +126,13 @@ func (s *parameters) DeepObjectQueryParamsObject(ctx context.Context, objParam s if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -132,7 +146,7 @@ func (s *parameters) DeepObjectQueryParamsObject(ctx context.Context, objParam s switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.DeepObjectQueryParamsObjectRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -172,7 +186,13 @@ func (s *parameters) FormQueryParamsArray(ctx context.Context, arrParam []string if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -186,7 +206,7 @@ func (s *parameters) FormQueryParamsArray(ctx context.Context, arrParam []string switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.FormQueryParamsArrayRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -226,7 +246,13 @@ func (s *parameters) FormQueryParamsMap(ctx context.Context, mapParam map[string if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -240,7 +266,7 @@ func (s *parameters) FormQueryParamsMap(ctx context.Context, mapParam map[string switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.FormQueryParamsMapRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -280,7 +306,13 @@ func (s *parameters) FormQueryParamsObject(ctx context.Context, objParamExploded if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -294,7 +326,7 @@ func (s *parameters) FormQueryParamsObject(ctx context.Context, objParamExploded switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.FormQueryParamsObjectRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -336,7 +368,13 @@ func (s *parameters) FormQueryParamsPrimitive(ctx context.Context, boolParam boo if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -350,7 +388,7 @@ func (s *parameters) FormQueryParamsPrimitive(ctx context.Context, boolParam boo switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.FormQueryParamsPrimitiveRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -390,7 +428,13 @@ func (s *parameters) FormQueryParamsRefParamObject(ctx context.Context, refObjPa if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -404,7 +448,7 @@ func (s *parameters) FormQueryParamsRefParamObject(ctx context.Context, refObjPa switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.FormQueryParamsRefParamObjectRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -441,7 +485,13 @@ func (s *parameters) HeaderParamsArray(ctx context.Context, xHeaderArray []strin if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -455,7 +505,7 @@ func (s *parameters) HeaderParamsArray(ctx context.Context, xHeaderArray []strin switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.HeaderParamsArrayRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -493,7 +543,13 @@ func (s *parameters) HeaderParamsMap(ctx context.Context, xHeaderMap map[string] if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -507,7 +563,7 @@ func (s *parameters) HeaderParamsMap(ctx context.Context, xHeaderMap map[string] switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.HeaderParamsMapRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -545,7 +601,13 @@ func (s *parameters) HeaderParamsObject(ctx context.Context, xHeaderObj shared.S if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -559,7 +621,7 @@ func (s *parameters) HeaderParamsObject(ctx context.Context, xHeaderObj shared.S switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.HeaderParamsObjectRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -599,7 +661,13 @@ func (s *parameters) HeaderParamsPrimitive(ctx context.Context, xHeaderBoolean b if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -613,7 +681,7 @@ func (s *parameters) HeaderParamsPrimitive(ctx context.Context, xHeaderBoolean b switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.HeaderParamsPrimitiveRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -653,7 +721,13 @@ func (s *parameters) JSONQueryParamsObject(ctx context.Context, deepObjParam sha if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -667,7 +741,7 @@ func (s *parameters) JSONQueryParamsObject(ctx context.Context, deepObjParam sha switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.JSONQueryParamsObjectRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -708,7 +782,13 @@ func (s *parameters) MixedQueryParams(ctx context.Context, deepObjectParam share if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -722,7 +802,7 @@ func (s *parameters) MixedQueryParams(ctx context.Context, deepObjectParam share switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.MixedQueryParamsRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -760,7 +840,13 @@ func (s *parameters) PathParameterJSON(ctx context.Context, jsonObj shared.Simpl if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -774,7 +860,7 @@ func (s *parameters) PathParameterJSON(ctx context.Context, jsonObj shared.Simpl switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.PathParameterJSONRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -816,7 +902,13 @@ func (s *parameters) PipeDelimitedQueryParamsArray(ctx context.Context, arrParam if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -830,7 +922,7 @@ func (s *parameters) PipeDelimitedQueryParamsArray(ctx context.Context, arrParam switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.PipeDelimitedQueryParamsArrayRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -868,7 +960,13 @@ func (s *parameters) SimplePathParameterArrays(ctx context.Context, arrParam []s if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -882,7 +980,7 @@ func (s *parameters) SimplePathParameterArrays(ctx context.Context, arrParam []s switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.SimplePathParameterArraysRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -921,7 +1019,13 @@ func (s *parameters) SimplePathParameterMaps(ctx context.Context, mapParam map[s if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -935,7 +1039,7 @@ func (s *parameters) SimplePathParameterMaps(ctx context.Context, mapParam map[s switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.SimplePathParameterMapsRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -974,7 +1078,13 @@ func (s *parameters) SimplePathParameterObjects(ctx context.Context, objParam sh if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -988,7 +1098,7 @@ func (s *parameters) SimplePathParameterObjects(ctx context.Context, objParam sh switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.SimplePathParameterObjectsRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -1029,7 +1139,13 @@ func (s *parameters) SimplePathParameterPrimitives(ctx context.Context, boolPara if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -1043,7 +1159,7 @@ func (s *parameters) SimplePathParameterPrimitives(ctx context.Context, boolPara switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.SimplePathParameterPrimitivesRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } diff --git a/go-client-sdk/pkg/models/operations/deprecatedwithcommentsget.go b/go-client-sdk/pkg/models/operations/deprecatedwithcommentsget.go index af8a14ccd..3c8182dfc 100755 --- a/go-client-sdk/pkg/models/operations/deprecatedwithcommentsget.go +++ b/go-client-sdk/pkg/models/operations/deprecatedwithcommentsget.go @@ -9,7 +9,7 @@ import ( type DeprecatedWithCommentsGetRequest struct { // This is a string parameter // - // Deprecated: this field will be removed in a future release, please migrate away from it as soon as possible. + // Deprecated: this field will be removed in a future release, please migrate away from it as soon as possible. Use NewParameter instead. DeprecatedParameter *string `queryParam:"style=form,explode=true,name=deprecatedParameter"` // This is a string parameter NewParameter *string `queryParam:"style=form,explode=true,name=newParameter"` diff --git a/go-client-sdk/requestbodies.go b/go-client-sdk/requestbodies.go index ea5387b9d..16124896c 100755 --- a/go-client-sdk/requestbodies.go +++ b/go-client-sdk/requestbodies.go @@ -3,8 +3,10 @@ package sdk import ( + "bytes" "context" "fmt" + "io" "net/http" "openapi/pkg/models/operations" "openapi/pkg/models/shared" @@ -76,7 +78,13 @@ func (s *requestBodies) RequestBodyPostApplicationJSONArray(ctx context.Context, if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -90,7 +98,7 @@ func (s *requestBodies) RequestBodyPostApplicationJSONArray(ctx context.Context, switch { case utils.MatchContentType(contentType, `application/json`): var out []shared.SimpleObject - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -131,7 +139,13 @@ func (s *requestBodies) RequestBodyPostApplicationJSONArrayObj(ctx context.Conte if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -145,7 +159,7 @@ func (s *requestBodies) RequestBodyPostApplicationJSONArrayObj(ctx context.Conte switch { case utils.MatchContentType(contentType, `application/json`): var out *shared.ArrObjValue - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -197,7 +211,13 @@ func (s *requestBodies) RequestBodyPostApplicationJSONArrayOfArray(ctx context.C if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -211,7 +231,7 @@ func (s *requestBodies) RequestBodyPostApplicationJSONArrayOfArray(ctx context.C switch { case utils.MatchContentType(contentType, `application/json`): var out [][]shared.SimpleObject - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -263,7 +283,13 @@ func (s *requestBodies) RequestBodyPostApplicationJSONArrayOfArrayOfPrimitive(ct if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -277,7 +303,7 @@ func (s *requestBodies) RequestBodyPostApplicationJSONArrayOfArrayOfPrimitive(ct switch { case utils.MatchContentType(contentType, `application/json`): var out [][]string - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -329,7 +355,13 @@ func (s *requestBodies) RequestBodyPostApplicationJSONArrayOfMap(ctx context.Con if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -343,7 +375,7 @@ func (s *requestBodies) RequestBodyPostApplicationJSONArrayOfMap(ctx context.Con switch { case utils.MatchContentType(contentType, `application/json`): var out []map[string]shared.SimpleObject - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -395,7 +427,13 @@ func (s *requestBodies) RequestBodyPostApplicationJSONArrayOfPrimitive(ctx conte if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -409,7 +447,7 @@ func (s *requestBodies) RequestBodyPostApplicationJSONArrayOfPrimitive(ctx conte switch { case utils.MatchContentType(contentType, `application/json`): var out []string - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -447,7 +485,13 @@ func (s *requestBodies) RequestBodyPostApplicationJSONDeep(ctx context.Context, if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -461,7 +505,7 @@ func (s *requestBodies) RequestBodyPostApplicationJSONDeep(ctx context.Context, switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.RequestBodyPostApplicationJSONDeepRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -513,7 +557,13 @@ func (s *requestBodies) RequestBodyPostApplicationJSONMap(ctx context.Context, r if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -527,7 +577,7 @@ func (s *requestBodies) RequestBodyPostApplicationJSONMap(ctx context.Context, r switch { case utils.MatchContentType(contentType, `application/json`): var out map[string]shared.SimpleObject - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -568,7 +618,13 @@ func (s *requestBodies) RequestBodyPostApplicationJSONMapObj(ctx context.Context if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -582,7 +638,7 @@ func (s *requestBodies) RequestBodyPostApplicationJSONMapObj(ctx context.Context switch { case utils.MatchContentType(contentType, `application/json`): var out *shared.MapObjValue - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -634,7 +690,13 @@ func (s *requestBodies) RequestBodyPostApplicationJSONMapOfArray(ctx context.Con if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -648,7 +710,7 @@ func (s *requestBodies) RequestBodyPostApplicationJSONMapOfArray(ctx context.Con switch { case utils.MatchContentType(contentType, `application/json`): var out map[string][]shared.SimpleObject - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -700,7 +762,13 @@ func (s *requestBodies) RequestBodyPostApplicationJSONMapOfMap(ctx context.Conte if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -714,7 +782,7 @@ func (s *requestBodies) RequestBodyPostApplicationJSONMapOfMap(ctx context.Conte switch { case utils.MatchContentType(contentType, `application/json`): var out map[string]map[string]shared.SimpleObject - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -766,7 +834,13 @@ func (s *requestBodies) RequestBodyPostApplicationJSONMapOfMapOfPrimitive(ctx co if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -780,7 +854,7 @@ func (s *requestBodies) RequestBodyPostApplicationJSONMapOfMapOfPrimitive(ctx co switch { case utils.MatchContentType(contentType, `application/json`): var out map[string]map[string]string - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -832,7 +906,13 @@ func (s *requestBodies) RequestBodyPostApplicationJSONMapOfPrimitive(ctx context if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -846,7 +926,7 @@ func (s *requestBodies) RequestBodyPostApplicationJSONMapOfPrimitive(ctx context switch { case utils.MatchContentType(contentType, `application/json`): var out map[string]string - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -887,7 +967,13 @@ func (s *requestBodies) RequestBodyPostApplicationJSONMultipleJSONFiltered(ctx c if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -901,7 +987,7 @@ func (s *requestBodies) RequestBodyPostApplicationJSONMultipleJSONFiltered(ctx c switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.RequestBodyPostApplicationJSONMultipleJSONFilteredRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -942,7 +1028,13 @@ func (s *requestBodies) RequestBodyPostApplicationJSONSimple(ctx context.Context if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -956,7 +1048,7 @@ func (s *requestBodies) RequestBodyPostApplicationJSONSimple(ctx context.Context switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.RequestBodyPostApplicationJSONSimpleRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -997,7 +1089,13 @@ func (s *requestBodies) RequestBodyPostFormDeep(ctx context.Context, request sha if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -1011,7 +1109,7 @@ func (s *requestBodies) RequestBodyPostFormDeep(ctx context.Context, request sha switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.RequestBodyPostFormDeepRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -1052,7 +1150,13 @@ func (s *requestBodies) RequestBodyPostFormMapPrimitive(ctx context.Context, req if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -1066,7 +1170,7 @@ func (s *requestBodies) RequestBodyPostFormMapPrimitive(ctx context.Context, req switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.RequestBodyPostFormMapPrimitiveRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -1107,7 +1211,13 @@ func (s *requestBodies) RequestBodyPostFormSimple(ctx context.Context, request s if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -1121,7 +1231,7 @@ func (s *requestBodies) RequestBodyPostFormSimple(ctx context.Context, request s switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.RequestBodyPostFormSimpleRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -1162,7 +1272,13 @@ func (s *requestBodies) RequestBodyPostMultipleContentTypesComponentFiltered(ctx if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -1176,7 +1292,7 @@ func (s *requestBodies) RequestBodyPostMultipleContentTypesComponentFiltered(ctx switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.RequestBodyPostMultipleContentTypesComponentFilteredRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -1217,7 +1333,13 @@ func (s *requestBodies) RequestBodyPostMultipleContentTypesInlineFiltered(ctx co if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -1231,7 +1353,7 @@ func (s *requestBodies) RequestBodyPostMultipleContentTypesInlineFiltered(ctx co switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.RequestBodyPostMultipleContentTypesInlineFilteredRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -1281,7 +1403,13 @@ func (s *requestBodies) RequestBodyPostMultipleContentTypesSplitParamForm(ctx co if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -1295,7 +1423,7 @@ func (s *requestBodies) RequestBodyPostMultipleContentTypesSplitParamForm(ctx co switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.RequestBodyPostMultipleContentTypesSplitParamFormRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -1345,7 +1473,13 @@ func (s *requestBodies) RequestBodyPostMultipleContentTypesSplitParamJSON(ctx co if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -1359,7 +1493,7 @@ func (s *requestBodies) RequestBodyPostMultipleContentTypesSplitParamJSON(ctx co switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.RequestBodyPostMultipleContentTypesSplitParamJSONRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -1409,7 +1543,13 @@ func (s *requestBodies) RequestBodyPostMultipleContentTypesSplitParamMultipart(c if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -1423,7 +1563,7 @@ func (s *requestBodies) RequestBodyPostMultipleContentTypesSplitParamMultipart(c switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.RequestBodyPostMultipleContentTypesSplitParamMultipartRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -1464,7 +1604,13 @@ func (s *requestBodies) RequestBodyPostMultipleContentTypesSplitForm(ctx context if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -1478,7 +1624,7 @@ func (s *requestBodies) RequestBodyPostMultipleContentTypesSplitForm(ctx context switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.RequestBodyPostMultipleContentTypesSplitFormRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -1519,7 +1665,13 @@ func (s *requestBodies) RequestBodyPostMultipleContentTypesSplitJSON(ctx context if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -1533,7 +1685,7 @@ func (s *requestBodies) RequestBodyPostMultipleContentTypesSplitJSON(ctx context switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.RequestBodyPostMultipleContentTypesSplitJSONRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -1574,7 +1726,13 @@ func (s *requestBodies) RequestBodyPostMultipleContentTypesSplitMultipart(ctx co if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -1588,7 +1746,7 @@ func (s *requestBodies) RequestBodyPostMultipleContentTypesSplitMultipart(ctx co switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.RequestBodyPostMultipleContentTypesSplitMultipartRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -1629,7 +1787,13 @@ func (s *requestBodies) RequestBodyPutBytes(ctx context.Context, request []byte) if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -1643,7 +1807,7 @@ func (s *requestBodies) RequestBodyPutBytes(ctx context.Context, request []byte) switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.RequestBodyPutBytesRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -1684,7 +1848,13 @@ func (s *requestBodies) RequestBodyPutMultipartDeep(ctx context.Context, request if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -1698,7 +1868,7 @@ func (s *requestBodies) RequestBodyPutMultipartDeep(ctx context.Context, request switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.RequestBodyPutMultipartDeepRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -1739,7 +1909,13 @@ func (s *requestBodies) RequestBodyPutMultipartFile(ctx context.Context, request if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -1753,7 +1929,7 @@ func (s *requestBodies) RequestBodyPutMultipartFile(ctx context.Context, request switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.RequestBodyPutMultipartFileRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -1794,7 +1970,13 @@ func (s *requestBodies) RequestBodyPutMultipartSimple(ctx context.Context, reque if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -1808,7 +1990,7 @@ func (s *requestBodies) RequestBodyPutMultipartSimple(ctx context.Context, reque switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.RequestBodyPutMultipartSimpleRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -1849,7 +2031,13 @@ func (s *requestBodies) RequestBodyPutString(ctx context.Context, request string if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -1863,7 +2051,7 @@ func (s *requestBodies) RequestBodyPutString(ctx context.Context, request string switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.RequestBodyPutStringRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } diff --git a/go-client-sdk/responsebodies.go b/go-client-sdk/responsebodies.go index 2d2c4f9e6..4c2c34d7d 100755 --- a/go-client-sdk/responsebodies.go +++ b/go-client-sdk/responsebodies.go @@ -3,6 +3,7 @@ package sdk import ( + "bytes" "context" "fmt" "io" @@ -55,7 +56,13 @@ func (s *responseBodies) ResponseBodyBytesGet(ctx context.Context) (*operations. if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -68,12 +75,7 @@ func (s *responseBodies) ResponseBodyBytesGet(ctx context.Context) (*operations. case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/octet-stream`): - out, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - - res.Bytes = out + res.Bytes = rawBody } } @@ -100,7 +102,13 @@ func (s *responseBodies) ResponseBodyStringGet(ctx context.Context) (*operations if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -113,12 +121,7 @@ func (s *responseBodies) ResponseBodyStringGet(ctx context.Context) (*operations case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `text/html`): - data, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - - out := string(data) + out := string(rawBody) res.HTML = &out } } @@ -146,7 +149,13 @@ func (s *responseBodies) ResponseBodyXMLGet(ctx context.Context) (*operations.Re if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -159,12 +168,7 @@ func (s *responseBodies) ResponseBodyXMLGet(ctx context.Context) (*operations.Re case httpRes.StatusCode == 200: switch { case utils.MatchContentType(contentType, `application/xml`): - data, err := io.ReadAll(httpRes.Body) - if err != nil { - return nil, fmt.Errorf("error reading response body: %w", err) - } - - out := string(data) + out := string(rawBody) res.XML = &out } } diff --git a/go-client-sdk/sdk.go b/go-client-sdk/sdk.go index 5aeb23e07..3be4959d6 100755 --- a/go-client-sdk/sdk.go +++ b/go-client-sdk/sdk.go @@ -3,8 +3,10 @@ package sdk import ( + "bytes" "context" "fmt" + "io" "net/http" "openapi/pkg/models/operations" "openapi/pkg/models/shared" @@ -147,8 +149,8 @@ func WithGlobalQueryParam(globalQueryParam string) SDKOption { func New(opts ...SDKOption) *SDK { sdk := &SDK{ _language: "go", - _sdkVersion: "1.2.1", - _genVersion: "2.31.0", + _sdkVersion: "1.3.0", + _genVersion: "2.32.2", _globals: map[string]map[string]map[string]interface{}{ "parameters": {}, @@ -324,7 +326,13 @@ func (s *SDK) PutAnythingIgnoredGeneration(ctx context.Context, request string) if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -338,7 +346,7 @@ func (s *SDK) PutAnythingIgnoredGeneration(ctx context.Context, request string) switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.PutAnythingIgnoredGeneration200ApplicationJSON - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -369,7 +377,13 @@ func (s *SDK) ResponseBodyJSONGet(ctx context.Context) (*operations.ResponseBody if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -383,7 +397,7 @@ func (s *SDK) ResponseBodyJSONGet(ctx context.Context) (*operations.ResponseBody switch { case utils.MatchContentType(contentType, `application/json`): var out *shared.HTTPBinSimpleJSONObject - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } diff --git a/go-client-sdk/servers.go b/go-client-sdk/servers.go index 7b05d811b..13d7ae563 100755 --- a/go-client-sdk/servers.go +++ b/go-client-sdk/servers.go @@ -3,8 +3,10 @@ package sdk import ( + "bytes" "context" "fmt" + "io" "net/http" "openapi/pkg/models/operations" "strings" @@ -53,7 +55,13 @@ func (s *servers) SelectGlobalServer(ctx context.Context) (*operations.SelectGlo if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -105,7 +113,13 @@ func (s *servers) SelectServerWithID(ctx context.Context, opts ...operations.Opt if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -155,7 +169,13 @@ func (s *servers) ServerWithTemplates(ctx context.Context, opts ...operations.Op if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -191,7 +211,13 @@ func (s *servers) ServerWithTemplatesGlobal(ctx context.Context) (*operations.Se if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") diff --git a/go-client-sdk/telemetry.go b/go-client-sdk/telemetry.go index b7a9a3051..ae204a0ff 100755 --- a/go-client-sdk/telemetry.go +++ b/go-client-sdk/telemetry.go @@ -3,8 +3,10 @@ package sdk import ( + "bytes" "context" "fmt" + "io" "net/http" "openapi/pkg/models/operations" "openapi/pkg/utils" @@ -60,7 +62,13 @@ func (s *telemetry) TelemetrySpeakeasyUserAgentGet(ctx context.Context, userAgen if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -74,7 +82,7 @@ func (s *telemetry) TelemetrySpeakeasyUserAgentGet(ctx context.Context, userAgen switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.TelemetrySpeakeasyUserAgentGetRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -105,7 +113,13 @@ func (s *telemetry) TelemetryUserAgentGet(ctx context.Context) (*operations.Tele if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -119,7 +133,7 @@ func (s *telemetry) TelemetryUserAgentGet(ctx context.Context) (*operations.Tele switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.TelemetryUserAgentGetRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } diff --git a/go-client-sdk/tests/responsebodies_test.go b/go-client-sdk/tests/responsebodies_test.go index aaae7e196..25068cb08 100755 --- a/go-client-sdk/tests/responsebodies_test.go +++ b/go-client-sdk/tests/responsebodies_test.go @@ -4,6 +4,7 @@ package tests import ( "context" + "io" "net/http" "testing" @@ -46,6 +47,10 @@ func TestResponseBodyJSONGet(t *testing.T) { }, }, }, res.HTTPBinSimpleJSONObject) + + data, err := io.ReadAll(res.RawResponse.Body) + assert.NoError(t, err) + assert.Equal(t, "{\n \"slideshow\": {\n \"author\": \"Yours Truly\", \n \"date\": \"date of publication\", \n \"slides\": [\n {\n \"title\": \"Wake up to WonderWidgets!\", \n \"type\": \"all\"\n }, \n {\n \"items\": [\n \"Why WonderWidgets are great\", \n \"Who buys WonderWidgets\"\n ], \n \"title\": \"Overview\", \n \"type\": \"all\"\n }\n ], \n \"title\": \"Sample Slide Show\"\n }\n}\n", string(data)) } func TestResponseBodyStringGet(t *testing.T) { diff --git a/go-client-sdk/tests/telemetry_test.go b/go-client-sdk/tests/telemetry_test.go index 7e568cd41..997d5e844 100755 --- a/go-client-sdk/tests/telemetry_test.go +++ b/go-client-sdk/tests/telemetry_test.go @@ -22,7 +22,7 @@ func TestTelemetryUserAgentGet(t *testing.T) { require.NoError(t, err) require.NotNil(t, res) assert.Equal(t, http.StatusOK, res.StatusCode) - assert.Equal(t, "speakeasy-sdk/go 1.2.1 2.31.0", res.Res.Headers["X-Speakeasy-User-Agent"]) + assert.Equal(t, "speakeasy-sdk/go 1.3.0 2.32.2", res.Res.Headers["X-Speakeasy-User-Agent"]) } func TestTelemetrySpeakeasyUserAgentGet(t *testing.T) { @@ -37,5 +37,5 @@ func TestTelemetrySpeakeasyUserAgentGet(t *testing.T) { require.NotNil(t, res) assert.Equal(t, http.StatusOK, res.StatusCode) assert.Equal(t, userAgent, res.Res.Headers["User-Agent"]) - assert.Equal(t, "speakeasy-sdk/go 1.2.1 2.31.0", res.Res.Headers["X-Speakeasy-User-Agent"]) + assert.Equal(t, "speakeasy-sdk/go 1.3.0 2.32.2", res.Res.Headers["X-Speakeasy-User-Agent"]) } diff --git a/go-client-sdk/unions.go b/go-client-sdk/unions.go index c188b6cea..599381242 100755 --- a/go-client-sdk/unions.go +++ b/go-client-sdk/unions.go @@ -3,8 +3,10 @@ package sdk import ( + "bytes" "context" "fmt" + "io" "net/http" "openapi/pkg/models/operations" "openapi/pkg/models/shared" @@ -65,7 +67,13 @@ func (s *unions) MixedTypeOneOfPost(ctx context.Context, request operations.Mixe if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -79,7 +87,7 @@ func (s *unions) MixedTypeOneOfPost(ctx context.Context, request operations.Mixe switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.MixedTypeOneOfPostRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -120,7 +128,13 @@ func (s *unions) PrimitiveTypeOneOfPost(ctx context.Context, request operations. if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -134,7 +148,7 @@ func (s *unions) PrimitiveTypeOneOfPost(ctx context.Context, request operations. switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.PrimitiveTypeOneOfPostRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -175,7 +189,13 @@ func (s *unions) StronglyTypedOneOfPost(ctx context.Context, request shared.Stro if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -189,7 +209,7 @@ func (s *unions) StronglyTypedOneOfPost(ctx context.Context, request shared.Stro switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.StronglyTypedOneOfPostRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -230,7 +250,13 @@ func (s *unions) TypedObjectOneOfPost(ctx context.Context, request shared.TypedO if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -244,7 +270,7 @@ func (s *unions) TypedObjectOneOfPost(ctx context.Context, request shared.TypedO switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.TypedObjectOneOfPostRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } @@ -285,7 +311,13 @@ func (s *unions) WeaklyTypedOneOfPost(ctx context.Context, request shared.Weakly if httpRes == nil { return nil, fmt.Errorf("error sending request: no response") } - defer httpRes.Body.Close() + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) contentType := httpRes.Header.Get("Content-Type") @@ -299,7 +331,7 @@ func (s *unions) WeaklyTypedOneOfPost(ctx context.Context, request shared.Weakly switch { case utils.MatchContentType(contentType, `application/json`): var out *operations.WeaklyTypedOneOfPostRes - if err := utils.UnmarshalJsonFromResponseBody(httpRes.Body, &out); err != nil { + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { return nil, err } diff --git a/java-client-sdk/README.md b/java-client-sdk/README.md index 0b24940f8..bbcb64ded 100755 --- a/java-client-sdk/README.md +++ b/java-client-sdk/README.md @@ -6,7 +6,7 @@ ### Gradle ```groovy -implementation 'org.openapis.openapi:openapi:1.2.1' +implementation 'org.openapis.openapi:openapi:1.3.0' ``` @@ -127,7 +127,7 @@ public class Application { * [anchorTypesGet](docs/generation/README.md#anchortypesget) * [circularReferenceGet](docs/generation/README.md#circularreferenceget) * [~~deprecatedNoCommentsGet~~](docs/generation/README.md#deprecatednocommentsget) - :warning: **Deprecated** -* [~~deprecatedWithCommentsGet~~](docs/generation/README.md#deprecatedwithcommentsget) - This is an endpoint setup to test deprecation with comments :warning: **Deprecated** +* [~~deprecatedWithCommentsGet~~](docs/generation/README.md#deprecatedwithcommentsget) - This is an endpoint setup to test deprecation with comments :warning: **Deprecated** - Use `simplePathParameterObjects` instead. * [globalNameOverridden](docs/generation/README.md#globalnameoverridden) * [ignoredGenerationGet](docs/generation/README.md#ignoredgenerationget) * [ignoresPost](docs/generation/README.md#ignorespost) diff --git a/java-client-sdk/docs/generation/README.md b/java-client-sdk/docs/generation/README.md index e76375ba4..9e432496c 100755 --- a/java-client-sdk/docs/generation/README.md +++ b/java-client-sdk/docs/generation/README.md @@ -9,7 +9,7 @@ Endpoints for purely testing valid generation behavior. * [anchorTypesGet](#anchortypesget) * [circularReferenceGet](#circularreferenceget) * [~~deprecatedNoCommentsGet~~](#deprecatednocommentsget) - :warning: **Deprecated** -* [~~deprecatedWithCommentsGet~~](#deprecatedwithcommentsget) - This is an endpoint setup to test deprecation with comments :warning: **Deprecated** +* [~~deprecatedWithCommentsGet~~](#deprecatedwithcommentsget) - This is an endpoint setup to test deprecation with comments :warning: **Deprecated** - Use `simplePathParameterObjects` instead. * [globalNameOverridden](#globalnameoverridden) * [ignoredGenerationGet](#ignoredgenerationget) * [ignoresPost](#ignorespost) @@ -125,7 +125,7 @@ public class Application { This is an endpoint setup to test deprecation with comments -> :warning: **DEPRECATED**: this method will be removed in a future release, please migrate away from it as soon as possible. +> :warning: **DEPRECATED**: this method will be removed in a future release, please migrate away from it as soon as possible. Use `simplePathParameterObjects` instead. ### Example Usage diff --git a/java-client-sdk/gen.yaml b/java-client-sdk/gen.yaml index 098633684..f966a56a8 100755 --- a/java-client-sdk/gen.yaml +++ b/java-client-sdk/gen.yaml @@ -2,13 +2,13 @@ configVersion: 1.0.0 management: docChecksum: 76623f721a416be989cb70240cd8b7e1 docVersion: 0.0.1 - speakeasyVersion: 1.36.3 - generationVersion: 2.31.0 + speakeasyVersion: 1.37.5 + generationVersion: 2.32.2 generation: sdkClassName: SDK singleTagPerOp: false java: - version: 1.2.1 + version: 1.3.0 artifactID: openapi companyEmail: info@mycompany.com companyName: My Company diff --git a/java-client-sdk/lib/build.gradle b/java-client-sdk/lib/build.gradle index 68a63461a..9ac52c3f3 100755 --- a/java-client-sdk/lib/build.gradle +++ b/java-client-sdk/lib/build.gradle @@ -42,7 +42,7 @@ publishing { maven(MavenPublication) { groupId = 'org.openapis' artifactId = 'openapi' - version = '1.2.1' + version = '1.3.0' from components.java diff --git a/java-client-sdk/lib/src/main/java/org/openapis/openapi/Generation.java b/java-client-sdk/lib/src/main/java/org/openapis/openapi/Generation.java index 56306ebfe..6c6a16c39 100755 --- a/java-client-sdk/lib/src/main/java/org/openapis/openapi/Generation.java +++ b/java-client-sdk/lib/src/main/java/org/openapis/openapi/Generation.java @@ -159,7 +159,7 @@ public org.openapis.openapi.models.operations.DeprecatedNoCommentsGetResponse de * This is an endpoint setup to test deprecation with comments * @return the response from the API call * @throws Exception if the API call fails - * @deprecated this method will be removed in a future release, please migrate away from it as soon as possible + * @deprecated this method will be removed in a future release, please migrate away from it as soon as possible. Use simplePathParameterObjects instead */ @Deprecated public org.openapis.openapi.models.operations.DeprecatedWithCommentsGetResponse deprecatedWithCommentsGet() throws Exception { @@ -171,7 +171,7 @@ public org.openapis.openapi.models.operations.DeprecatedWithCommentsGetResponse * @param deprecatedParameter This is a string parameter * @return the response from the API call * @throws Exception if the API call fails - * @deprecated this method will be removed in a future release, please migrate away from it as soon as possible + * @deprecated this method will be removed in a future release, please migrate away from it as soon as possible. Use simplePathParameterObjects instead */ @Deprecated public org.openapis.openapi.models.operations.DeprecatedWithCommentsGetResponse deprecatedWithCommentsGet(String deprecatedParameter) throws Exception { @@ -184,7 +184,7 @@ public org.openapis.openapi.models.operations.DeprecatedWithCommentsGetResponse * @param newParameter This is a string parameter * @return the response from the API call * @throws Exception if the API call fails - * @deprecated this method will be removed in a future release, please migrate away from it as soon as possible + * @deprecated this method will be removed in a future release, please migrate away from it as soon as possible. Use simplePathParameterObjects instead */ @Deprecated public org.openapis.openapi.models.operations.DeprecatedWithCommentsGetResponse deprecatedWithCommentsGet(String deprecatedParameter, String newParameter) throws Exception { diff --git a/java-client-sdk/lib/src/main/java/org/openapis/openapi/SDK.java b/java-client-sdk/lib/src/main/java/org/openapis/openapi/SDK.java index d58efd95c..e938a4ae4 100755 --- a/java-client-sdk/lib/src/main/java/org/openapis/openapi/SDK.java +++ b/java-client-sdk/lib/src/main/java/org/openapis/openapi/SDK.java @@ -94,8 +94,8 @@ public class SDK { private org.openapis.openapi.models.shared.Security _security; private String _serverUrl; private String _language = "java"; - private String _sdkVersion = "1.2.1"; - private String _genVersion = "2.31.0"; + private String _sdkVersion = "1.3.0"; + private String _genVersion = "2.32.2"; java.util.Map>> _globals; /** diff --git a/java-client-sdk/lib/src/main/java/org/openapis/openapi/models/operations/DeprecatedWithCommentsGetRequest.java b/java-client-sdk/lib/src/main/java/org/openapis/openapi/models/operations/DeprecatedWithCommentsGetRequest.java index 457133cf2..0b4ad4b5d 100755 --- a/java-client-sdk/lib/src/main/java/org/openapis/openapi/models/operations/DeprecatedWithCommentsGetRequest.java +++ b/java-client-sdk/lib/src/main/java/org/openapis/openapi/models/operations/DeprecatedWithCommentsGetRequest.java @@ -9,7 +9,7 @@ public class DeprecatedWithCommentsGetRequest { /** * This is a string parameter - * @deprecated this field will be removed in a future release, please migrate away from it as soon as possible + * @deprecated this field will be removed in a future release, please migrate away from it as soon as possible. Use newParameter instead */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=deprecatedParameter") @Deprecated diff --git a/java-client-sdk/lib/src/test/java/org/openapis/openapi/ResponseBodiesTests.java b/java-client-sdk/lib/src/test/java/org/openapis/openapi/ResponseBodiesTests.java index b1fd42055..b4c11a7cd 100755 --- a/java-client-sdk/lib/src/test/java/org/openapis/openapi/ResponseBodiesTests.java +++ b/java-client-sdk/lib/src/test/java/org/openapis/openapi/ResponseBodiesTests.java @@ -8,6 +8,8 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; +import java.nio.charset.StandardCharsets; + import org.junit.jupiter.api.Test; import org.openapis.openapi.models.operations.ResponseBodyBytesGetResponse; import org.openapis.openapi.models.operations.ResponseBodyJsonGetResponse; @@ -36,6 +38,9 @@ void testResponseBodyJsonGet() throws Exception { assertEquals("all", res.httpBinSimpleJsonObject.slideshow.slides[1].type); assertEquals("Why WonderWidgets are great", res.httpBinSimpleJsonObject.slideshow.slides[1].items[0]); assertEquals("Who buys WonderWidgets", res.httpBinSimpleJsonObject.slideshow.slides[1].items[1]); + assertEquals( + "{\n \"slideshow\": {\n \"author\": \"Yours Truly\", \n \"date\": \"date of publication\", \n \"slides\": [\n {\n \"title\": \"Wake up to WonderWidgets!\", \n \"type\": \"all\"\n }, \n {\n \"items\": [\n \"Why WonderWidgets are great\", \n \"Who buys WonderWidgets\"\n ], \n \"title\": \"Overview\", \n \"type\": \"all\"\n }\n ], \n \"title\": \"Sample Slide Show\"\n }\n}\n", + new String(res.rawResponse.body(), StandardCharsets.UTF_8)); } @Test diff --git a/java-client-sdk/lib/src/test/java/org/openapis/openapi/TelemetryTests.java b/java-client-sdk/lib/src/test/java/org/openapis/openapi/TelemetryTests.java index 1f0af2c27..804a8fccb 100755 --- a/java-client-sdk/lib/src/test/java/org/openapis/openapi/TelemetryTests.java +++ b/java-client-sdk/lib/src/test/java/org/openapis/openapi/TelemetryTests.java @@ -23,7 +23,7 @@ void testTelemetryUserAgentGet() throws Exception { assertNotNull(res); assertEquals(200, res.statusCode); - assertEquals("speakeasy-sdk/java 1.2.1 2.31.0", res.res.headers.get("X-Speakeasy-User-Agent")); + assertEquals("speakeasy-sdk/java 1.3.0 2.32.2", res.res.headers.get("X-Speakeasy-User-Agent")); } @Test @@ -40,6 +40,6 @@ void testTelemetrySpeakeasyUserAgentGet() throws Exception { assertNotNull(res); assertEquals(200, res.statusCode); assertEquals(userAgent, res.res.headers.get("User-Agent")); - assertEquals("speakeasy-sdk/java 1.2.1 2.31.0", res.res.headers.get("X-Speakeasy-User-Agent")); + assertEquals("speakeasy-sdk/java 1.3.0 2.32.2", res.res.headers.get("X-Speakeasy-User-Agent")); } } diff --git a/php-client-sdk/README.md b/php-client-sdk/README.md index c389ac8fc..9a296c355 100755 --- a/php-client-sdk/README.md +++ b/php-client-sdk/README.md @@ -140,7 +140,7 @@ try { * [anchorTypesGet](docs/generation/README.md#anchortypesget) * [circularReferenceGet](docs/generation/README.md#circularreferenceget) * [~~deprecatedNoCommentsGet~~](docs/generation/README.md#deprecatednocommentsget) - deprecatedNoCommentsGet :warning: **Deprecated** -* [~~deprecatedWithCommentsGet~~](docs/generation/README.md#deprecatedwithcommentsget) - This is an endpoint setup to test deprecation with comments :warning: **Deprecated** +* [~~deprecatedWithCommentsGet~~](docs/generation/README.md#deprecatedwithcommentsget) - This is an endpoint setup to test deprecation with comments :warning: **Deprecated** - Use `simplePathParameterObjects` instead. * [globalNameOverridden](docs/generation/README.md#globalnameoverridden) * [ignoredGenerationGet](docs/generation/README.md#ignoredgenerationget) * [ignoresPost](docs/generation/README.md#ignorespost) diff --git a/php-client-sdk/docs/generation/README.md b/php-client-sdk/docs/generation/README.md index ed3d428db..f49776dbb 100755 --- a/php-client-sdk/docs/generation/README.md +++ b/php-client-sdk/docs/generation/README.md @@ -9,7 +9,7 @@ Endpoints for purely testing valid generation behavior. * [anchorTypesGet](#anchortypesget) * [circularReferenceGet](#circularreferenceget) * [~~deprecatedNoCommentsGet~~](#deprecatednocommentsget) - deprecatedNoCommentsGet :warning: **Deprecated** -* [~~deprecatedWithCommentsGet~~](#deprecatedwithcommentsget) - This is an endpoint setup to test deprecation with comments :warning: **Deprecated** +* [~~deprecatedWithCommentsGet~~](#deprecatedwithcommentsget) - This is an endpoint setup to test deprecation with comments :warning: **Deprecated** - Use `simplePathParameterObjects` instead. * [globalNameOverridden](#globalnameoverridden) * [ignoredGenerationGet](#ignoredgenerationget) * [ignoresPost](#ignorespost) @@ -108,7 +108,7 @@ try { This is an endpoint setup to test deprecation with comments -> :warning: **DEPRECATED**: this method will be removed in a future release, please migrate away from it as soon as possible. +> :warning: **DEPRECATED**: this method will be removed in a future release, please migrate away from it as soon as possible. Use `simplePathParameterObjects` instead. ### Example Usage diff --git a/php-client-sdk/gen.yaml b/php-client-sdk/gen.yaml index e09cb074d..32460cd51 100755 --- a/php-client-sdk/gen.yaml +++ b/php-client-sdk/gen.yaml @@ -2,13 +2,13 @@ configVersion: 1.0.0 management: docChecksum: 76623f721a416be989cb70240cd8b7e1 docVersion: 0.0.1 - speakeasyVersion: 1.36.3 - generationVersion: 2.31.0 + speakeasyVersion: 1.37.5 + generationVersion: 2.32.2 generation: sdkClassName: SDK singleTagPerOp: false php: - version: 1.2.1 + version: 1.3.0 maxMethodParams: 5 namespace: OpenAPI\OpenAPI packageName: openapi/openapi diff --git a/php-client-sdk/src/Generation.php b/php-client-sdk/src/Generation.php index 82073ce2a..6999fbdbb 100755 --- a/php-client-sdk/src/Generation.php +++ b/php-client-sdk/src/Generation.php @@ -154,7 +154,7 @@ public function deprecatedNoCommentsGet( * @param ?string $deprecatedParameter * @param ?string $newParameter * @return \OpenAPI\OpenAPI\Models\Operations\DeprecatedWithCommentsGetResponse - * @deprecated this method will be removed in a future release, please migrate away from it as soon as possible + * @deprecated this method will be removed in a future release, please migrate away from it as soon as possible. Use simplePathParameterObjects instead */ public function deprecatedWithCommentsGet( ?string $deprecatedParameter = null, diff --git a/php-client-sdk/src/Models/Operations/DeprecatedWithCommentsGetRequest.php b/php-client-sdk/src/Models/Operations/DeprecatedWithCommentsGetRequest.php index 271d0e39f..6a8106894 100755 --- a/php-client-sdk/src/Models/Operations/DeprecatedWithCommentsGetRequest.php +++ b/php-client-sdk/src/Models/Operations/DeprecatedWithCommentsGetRequest.php @@ -15,7 +15,7 @@ class DeprecatedWithCommentsGetRequest * This is a string parameter * * @var ?string $deprecatedParameter - * @deprecated this field will be removed in a future release, please migrate away from it as soon as possible + * @deprecated this field will be removed in a future release, please migrate away from it as soon as possible. Use newParameter instead */ #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=deprecatedParameter')] public ?string $deprecatedParameter = null; diff --git a/php-client-sdk/src/SDK.php b/php-client-sdk/src/SDK.php index 6070f6041..71e4d7694 100755 --- a/php-client-sdk/src/SDK.php +++ b/php-client-sdk/src/SDK.php @@ -120,8 +120,8 @@ class SDK private ?Models\Shared\Security $_security; private string $_serverUrl; private string $_language = 'php'; - private string $_sdkVersion = '1.2.1'; - private string $_genVersion = '2.31.0'; + private string $_sdkVersion = '1.3.0'; + private string $_genVersion = '2.32.2'; /** @var array>> */ private ?array $_globals; diff --git a/php-client-sdk/tests/ResponseBodiesTest.php b/php-client-sdk/tests/ResponseBodiesTest.php index b436baca8..f82a7ad74 100755 --- a/php-client-sdk/tests/ResponseBodiesTest.php +++ b/php-client-sdk/tests/ResponseBodiesTest.php @@ -42,6 +42,8 @@ public function testResponseBodyJsonGet(): void $obj->slideshow->slides[] = $slide2; $this->assertEquals($obj, $response->httpBinSimpleJsonObject); + $response->rawResponse->getBody()->rewind(); + $this->assertEquals("{\n \"slideshow\": {\n \"author\": \"Yours Truly\", \n \"date\": \"date of publication\", \n \"slides\": [\n {\n \"title\": \"Wake up to WonderWidgets!\", \n \"type\": \"all\"\n }, \n {\n \"items\": [\n \"Why WonderWidgets are great\", \n \"Who buys WonderWidgets\"\n ], \n \"title\": \"Overview\", \n \"type\": \"all\"\n }\n ], \n \"title\": \"Sample Slide Show\"\n }\n}\n", $response->rawResponse->getBody()->getContents()); } public function testResponseBodyStringGet(): void diff --git a/php-client-sdk/tests/TelemetryTest.php b/php-client-sdk/tests/TelemetryTest.php index 608515622..04ee57afa 100755 --- a/php-client-sdk/tests/TelemetryTest.php +++ b/php-client-sdk/tests/TelemetryTest.php @@ -20,7 +20,7 @@ public function testTelemetryUserAgentGet(): void $this->assertNotNull($response); $this->assertEquals(200, $response->statusCode); - $this->assertEquals('speakeasy-sdk/php 1.2.1 2.31.0', $response->res->headers['X-Speakeasy-User-Agent']); + $this->assertEquals('speakeasy-sdk/php 1.3.0 2.32.2', $response->res->headers['X-Speakeasy-User-Agent']); } public function testTelemetrySpeakeasyUserAgentGet(): void @@ -38,6 +38,6 @@ public function testTelemetrySpeakeasyUserAgentGet(): void $this->assertNotNull($response); $this->assertEquals(200, $response->statusCode); $this->assertEquals($userAgent, $response->res->headers['User-Agent']); - $this->assertEquals('speakeasy-sdk/php 1.2.1 2.31.0', $response->res->headers['X-Speakeasy-User-Agent']); + $this->assertEquals('speakeasy-sdk/php 1.3.0 2.32.2', $response->res->headers['X-Speakeasy-User-Agent']); } } diff --git a/python-client-sdk/README.md b/python-client-sdk/README.md index c6e7f884f..e83eaed8e 100755 --- a/python-client-sdk/README.md +++ b/python-client-sdk/README.md @@ -124,7 +124,7 @@ if res.usage_example_post_200_application_json_object is not None: * [anchor_types_get](docs/generation/README.md#anchor_types_get) * [circular_reference_get](docs/generation/README.md#circular_reference_get) * [~~deprecated_no_comments_get~~](docs/generation/README.md#deprecated_no_comments_get) - :warning: **Deprecated** -* [~~deprecated_with_comments_get~~](docs/generation/README.md#deprecated_with_comments_get) - This is an endpoint setup to test deprecation with comments :warning: **Deprecated** +* [~~deprecated_with_comments_get~~](docs/generation/README.md#deprecated_with_comments_get) - This is an endpoint setup to test deprecation with comments :warning: **Deprecated** - Use `simple_path_parameter_objects` instead. * [global_name_overridden](docs/generation/README.md#global_name_overridden) * [ignored_generation_get](docs/generation/README.md#ignored_generation_get) * [ignores_post](docs/generation/README.md#ignores_post) diff --git a/python-client-sdk/docs/generation/README.md b/python-client-sdk/docs/generation/README.md index c31733057..adfbade9e 100755 --- a/python-client-sdk/docs/generation/README.md +++ b/python-client-sdk/docs/generation/README.md @@ -9,7 +9,7 @@ Endpoints for purely testing valid generation behavior. * [anchor_types_get](#anchor_types_get) * [circular_reference_get](#circular_reference_get) * [~~deprecated_no_comments_get~~](#deprecated_no_comments_get) - :warning: **Deprecated** -* [~~deprecated_with_comments_get~~](#deprecated_with_comments_get) - This is an endpoint setup to test deprecation with comments :warning: **Deprecated** +* [~~deprecated_with_comments_get~~](#deprecated_with_comments_get) - This is an endpoint setup to test deprecation with comments :warning: **Deprecated** - Use `simple_path_parameter_objects` instead. * [global_name_overridden](#global_name_overridden) * [ignored_generation_get](#ignored_generation_get) * [ignores_post](#ignores_post) @@ -91,7 +91,7 @@ if res.status_code == 200: This is an endpoint setup to test deprecation with comments -> :warning: **DEPRECATED**: this method will be removed in a future release, please migrate away from it as soon as possible. +> :warning: **DEPRECATED**: this method will be removed in a future release, please migrate away from it as soon as possible. Use `simple_path_parameter_objects` instead. ### Example Usage diff --git a/python-client-sdk/gen.yaml b/python-client-sdk/gen.yaml index 10bc90d97..d902a876b 100755 --- a/python-client-sdk/gen.yaml +++ b/python-client-sdk/gen.yaml @@ -2,13 +2,13 @@ configVersion: 1.0.0 management: docChecksum: 76623f721a416be989cb70240cd8b7e1 docVersion: 0.0.1 - speakeasyVersion: 1.36.3 - generationVersion: 2.31.0 + speakeasyVersion: 1.37.5 + generationVersion: 2.32.2 generation: sdkClassName: SDK singleTagPerOp: false python: - version: 1.2.1 + version: 1.3.0 author: Speakeasy description: Python Client SDK Generated by Speakeasy maxMethodParams: 5 diff --git a/python-client-sdk/setup.py b/python-client-sdk/setup.py index 61b03b13e..62947a29e 100755 --- a/python-client-sdk/setup.py +++ b/python-client-sdk/setup.py @@ -10,7 +10,7 @@ setuptools.setup( name="openapi", - version="1.2.1", + version="1.3.0", author="Speakeasy", description="Python Client SDK Generated by Speakeasy", long_description=long_description, diff --git a/python-client-sdk/src/sdk/generation.py b/python-client-sdk/src/sdk/generation.py index a96fc6890..1f3ad1542 100755 --- a/python-client-sdk/src/sdk/generation.py +++ b/python-client-sdk/src/sdk/generation.py @@ -99,7 +99,7 @@ def deprecated_no_comments_get(self, deprecated_parameter: Optional[str] = None) def deprecated_with_comments_get(self, deprecated_parameter: Optional[str] = None, new_parameter: Optional[str] = None) -> operations.DeprecatedWithCommentsGetResponse: r"""This is an endpoint setup to test deprecation with comments - Deprecated: this method will be removed in a future release, please migrate away from it as soon as possible + Deprecated: this method will be removed in a future release, please migrate away from it as soon as possible. Use simple_path_parameter_objects instead """ request = operations.DeprecatedWithCommentsGetRequest( deprecated_parameter=deprecated_parameter, diff --git a/python-client-sdk/src/sdk/models/operations/deprecatedwithcommentsget.py b/python-client-sdk/src/sdk/models/operations/deprecatedwithcommentsget.py index bf4ccfdef..8d3ff8dc7 100755 --- a/python-client-sdk/src/sdk/models/operations/deprecatedwithcommentsget.py +++ b/python-client-sdk/src/sdk/models/operations/deprecatedwithcommentsget.py @@ -12,7 +12,7 @@ class DeprecatedWithCommentsGetRequest: deprecated_parameter: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'deprecatedParameter', 'style': 'form', 'explode': True }}) r"""This is a string parameter - Deprecated: this field will be removed in a future release, please migrate away from it as soon as possible + Deprecated: this field will be removed in a future release, please migrate away from it as soon as possible. Use new_parameter instead """ new_parameter: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'newParameter', 'style': 'form', 'explode': True }}) r"""This is a string parameter""" diff --git a/python-client-sdk/src/sdk/sdk.py b/python-client-sdk/src/sdk/sdk.py index 51071d427..02512b343 100755 --- a/python-client-sdk/src/sdk/sdk.py +++ b/python-client-sdk/src/sdk/sdk.py @@ -62,8 +62,8 @@ class SDK: _security_client: requests_http.Session _server_url: str = SERVERS[0] _language: str = "python" - _sdk_version: str = "1.2.1" - _gen_version: str = "2.31.0" + _sdk_version: str = "1.3.0" + _gen_version: str = "2.32.2" _globals: dict[str, dict[str, dict[str, Any]]] def __init__(self, diff --git a/python-client-sdk/tests/test_response_bodies.py b/python-client-sdk/tests/test_response_bodies.py index d85c94450..22315f0ae 100755 --- a/python-client-sdk/tests/test_response_bodies.py +++ b/python-client-sdk/tests/test_response_bodies.py @@ -30,6 +30,7 @@ def test_response_body_json_get(): 1].items[0] == 'Why WonderWidgets are great' assert res.http_bin_simple_json_object.slideshow.slides[ 1].items[1] == 'Who buys WonderWidgets' + assert res.raw_response.text == "{\n \"slideshow\": {\n \"author\": \"Yours Truly\", \n \"date\": \"date of publication\", \n \"slides\": [\n {\n \"title\": \"Wake up to WonderWidgets!\", \n \"type\": \"all\"\n }, \n {\n \"items\": [\n \"Why WonderWidgets are great\", \n \"Who buys WonderWidgets\"\n ], \n \"title\": \"Overview\", \n \"type\": \"all\"\n }\n ], \n \"title\": \"Sample Slide Show\"\n }\n}\n" def test_response_body_string_get(): diff --git a/python-client-sdk/tests/test_telemetry.py b/python-client-sdk/tests/test_telemetry.py index d0f1249ef..5bb5d3d98 100755 --- a/python-client-sdk/tests/test_telemetry.py +++ b/python-client-sdk/tests/test_telemetry.py @@ -17,7 +17,7 @@ def test_telemetry_user_agent_get(): assert res is not None assert res.status_code == 200 assert res.res is not None - assert res.res.headers['X-Speakeasy-User-Agent'] == 'speakeasy-sdk/python 1.2.1 2.31.0' + assert res.res.headers['X-Speakeasy-User-Agent'] == 'speakeasy-sdk/python 1.3.0 2.32.2' def test_telemetry_speakeasy_user_agent_get(): @@ -33,4 +33,4 @@ def test_telemetry_speakeasy_user_agent_get(): assert res.status_code == 200 assert res.res is not None assert res.res.headers['User-Agent'] == user_agent - assert res.res.headers['X-Speakeasy-User-Agent'] == 'speakeasy-sdk/python 1.2.1 2.31.0' \ No newline at end of file + assert res.res.headers['X-Speakeasy-User-Agent'] == 'speakeasy-sdk/python 1.3.0 2.32.2' \ No newline at end of file diff --git a/ruby-client-sdk/README.md b/ruby-client-sdk/README.md index 34ee90246..c08970805 100755 --- a/ruby-client-sdk/README.md +++ b/ruby-client-sdk/README.md @@ -157,7 +157,7 @@ if ! res.usage_example_post_200_application_json_object.nil? * [anchor_types_get](docs/generation/README.md#anchor_types_get) * [circular_reference_get](docs/generation/README.md#circular_reference_get) * [~~deprecated_no_comments_get~~](docs/generation/README.md#deprecated_no_comments_get) - :warning: **Deprecated** -* [~~deprecated_with_comments_get~~](docs/generation/README.md#deprecated_with_comments_get) - This is an endpoint setup to test deprecation with comments :warning: **Deprecated** +* [~~deprecated_with_comments_get~~](docs/generation/README.md#deprecated_with_comments_get) - This is an endpoint setup to test deprecation with comments :warning: **Deprecated** - Use `simple_path_parameter_objects` instead. * [global_name_overridden](docs/generation/README.md#global_name_overridden) * [ignored_generation_get](docs/generation/README.md#ignored_generation_get) * [ignores_post](docs/generation/README.md#ignores_post) diff --git a/ruby-client-sdk/docs/generation/README.md b/ruby-client-sdk/docs/generation/README.md index 4ae38e6b2..ecae1fe1b 100755 --- a/ruby-client-sdk/docs/generation/README.md +++ b/ruby-client-sdk/docs/generation/README.md @@ -9,7 +9,7 @@ Endpoints for purely testing valid generation behavior. * [anchor_types_get](#anchor_types_get) * [circular_reference_get](#circular_reference_get) * [~~deprecated_no_comments_get~~](#deprecated_no_comments_get) - :warning: **Deprecated** -* [~~deprecated_with_comments_get~~](#deprecated_with_comments_get) - This is an endpoint setup to test deprecation with comments :warning: **Deprecated** +* [~~deprecated_with_comments_get~~](#deprecated_with_comments_get) - This is an endpoint setup to test deprecation with comments :warning: **Deprecated** - Use `simple_path_parameter_objects` instead. * [global_name_overridden](#global_name_overridden) * [ignored_generation_get](#ignored_generation_get) * [ignores_post](#ignores_post) @@ -82,7 +82,7 @@ if res.status == 200: This is an endpoint setup to test deprecation with comments -> :warning: **DEPRECATED**: this method will be removed in a future release, please migrate away from it as soon as possible. +> :warning: **DEPRECATED**: this method will be removed in a future release, please migrate away from it as soon as possible. Use `simple_path_parameter_objects` instead. ### Example Usage diff --git a/ruby-client-sdk/gen.yaml b/ruby-client-sdk/gen.yaml index 0cc702a20..e261950b2 100755 --- a/ruby-client-sdk/gen.yaml +++ b/ruby-client-sdk/gen.yaml @@ -2,13 +2,13 @@ configVersion: 1.0.0 management: docChecksum: 76623f721a416be989cb70240cd8b7e1 docVersion: 0.0.1 - speakeasyVersion: 1.36.3 - generationVersion: 2.31.0 + speakeasyVersion: 1.37.5 + generationVersion: 2.32.2 generation: sdkClassName: SDK singleTagPerOp: false ruby: - version: 1.2.1 + version: 1.3.0 author: Speakeasy description: Ruby Client SDK Generated by Speakeasy maxMethodParams: 5 diff --git a/ruby-client-sdk/lib/sdk/generation.rb b/ruby-client-sdk/lib/sdk/generation.rb index 86d06c00e..f992197ea 100755 --- a/ruby-client-sdk/lib/sdk/generation.rb +++ b/ruby-client-sdk/lib/sdk/generation.rb @@ -114,7 +114,7 @@ def deprecated_no_comments_get(deprecated_parameter = nil) def deprecated_with_comments_get(deprecated_parameter = nil, new_parameter = nil) # deprecated_with_comments_get - This is an endpoint setup to test deprecation with comments # - # @deprecated this null will be removed in a future release, please migrate away from it as soon as possible + # @deprecated this null will be removed in a future release, please migrate away from it as soon as possible. Use simple_path_parameter_objects instead request = Operations::DeprecatedWithCommentsGetRequest.new( deprecated_parameter: deprecated_parameter, new_parameter: new_parameter, diff --git a/ruby-client-sdk/lib/sdk/models/operations/deprecatedwithcommentsget.rb b/ruby-client-sdk/lib/sdk/models/operations/deprecatedwithcommentsget.rb index 64ce1d1bd..de173a8f6 100755 --- a/ruby-client-sdk/lib/sdk/models/operations/deprecatedwithcommentsget.rb +++ b/ruby-client-sdk/lib/sdk/models/operations/deprecatedwithcommentsget.rb @@ -14,7 +14,7 @@ class DeprecatedWithCommentsGetRequest < OpenApiSDK::Utils::FieldAugmented # This is a string parameter # - # @deprecated this true will be removed in a future release, please migrate away from it as soon as possible + # @deprecated this true will be removed in a future release, please migrate away from it as soon as possible. Use new_parameter instead field :deprecated_parameter, T.nilable(String), { 'query_param': { 'field_name': 'deprecatedParameter', 'style': 'form', 'explode': true } } # This is a string parameter field :new_parameter, T.nilable(String), { 'query_param': { 'field_name': 'newParameter', 'style': 'form', 'explode': true } } diff --git a/ruby-client-sdk/lib/sdk/sdk.rb b/ruby-client-sdk/lib/sdk/sdk.rb index d2d5040d4..25c65f98c 100755 --- a/ruby-client-sdk/lib/sdk/sdk.rb +++ b/ruby-client-sdk/lib/sdk/sdk.rb @@ -71,8 +71,8 @@ def initialize(security: nil, @security = nil @server_url = SERVERS[0] @language = 'ruby' - @sdk_version = '1.2.1' - @gen_version = '2.31.0' + @sdk_version = '1.3.0' + @gen_version = '2.32.2' init_sdks end diff --git a/ruby-client-sdk/openapi.gemspec b/ruby-client-sdk/openapi.gemspec index 30d00629e..dd6b32905 100755 --- a/ruby-client-sdk/openapi.gemspec +++ b/ruby-client-sdk/openapi.gemspec @@ -4,7 +4,7 @@ $LOAD_PATH.push File.expand_path('lib', __dir__) Gem::Specification.new do |s| s.name = 'openapi' - s.version = '1.2.1' + s.version = '1.3.0' s.platform = Gem::Platform::RUBY s.licenses = ['Apache-2.0'] s.summary = '' diff --git a/ruby-client-sdk/test/responsebodies_test.rb b/ruby-client-sdk/test/responsebodies_test.rb index 925967ed6..ad6642e3e 100755 --- a/ruby-client-sdk/test/responsebodies_test.rb +++ b/ruby-client-sdk/test/responsebodies_test.rb @@ -28,6 +28,7 @@ def test_response_body_json_get assert_equal('all', res.http_bin_simple_json_object.slideshow.slides[1].type) assert_equal(['Why WonderWidgets are great', 'Who buys WonderWidgets'], res.http_bin_simple_json_object.slideshow.slides[1].items) + assert_equal("{\n \"slideshow\": {\n \"author\": \"Yours Truly\", \n \"date\": \"date of publication\", \n \"slides\": [\n {\n \"title\": \"Wake up to WonderWidgets!\", \n \"type\": \"all\"\n }, \n {\n \"items\": [\n \"Why WonderWidgets are great\", \n \"Who buys WonderWidgets\"\n ], \n \"title\": \"Overview\", \n \"type\": \"all\"\n }\n ], \n \"title\": \"Sample Slide Show\"\n }\n}\n", res.raw_response.env.response_body) end def test_response_body_string_get diff --git a/ruby-client-sdk/test/telemetry_test.rb b/ruby-client-sdk/test/telemetry_test.rb index 9776b7ccd..6e61272ca 100755 --- a/ruby-client-sdk/test/telemetry_test.rb +++ b/ruby-client-sdk/test/telemetry_test.rb @@ -15,7 +15,7 @@ def test_telemetry_user_agent_get refute_nil(res) assert_equal(Rack::Utils.status_code(:ok), res.status_code) - assert_equal('speakeasy-sdk/ruby 1.2.1 2.31.0', res.res.headers['X-Speakeasy-User-Agent']) + assert_equal('speakeasy-sdk/ruby 1.3.0 2.32.2', res.res.headers['X-Speakeasy-User-Agent']) end @@ -29,7 +29,7 @@ def test_telemetry_speakeasy_user_agent_get refute_nil(res) assert_equal(Rack::Utils.status_code(:ok), res.status_code) assert_equal(user_agent, res.res.headers['User-Agent']) - assert_equal('speakeasy-sdk/ruby 1.2.1 2.31.0', res.res.headers['X-Speakeasy-User-Agent']) + assert_equal('speakeasy-sdk/ruby 1.3.0 2.32.2', res.res.headers['X-Speakeasy-User-Agent']) end end diff --git a/typescript-client-sdk/README.md b/typescript-client-sdk/README.md index 6473edbd2..e1cebb6e1 100755 --- a/typescript-client-sdk/README.md +++ b/typescript-client-sdk/README.md @@ -136,7 +136,7 @@ sdk.generation.usageExamplePost({ * [anchorTypesGet](docs/generation/README.md#anchortypesget) * [circularReferenceGet](docs/generation/README.md#circularreferenceget) * [~~deprecatedNoCommentsGet~~](docs/generation/README.md#deprecatednocommentsget) - :warning: **Deprecated** -* [~~deprecatedWithCommentsGet~~](docs/generation/README.md#deprecatedwithcommentsget) - This is an endpoint setup to test deprecation with comments :warning: **Deprecated** +* [~~deprecatedWithCommentsGet~~](docs/generation/README.md#deprecatedwithcommentsget) - This is an endpoint setup to test deprecation with comments :warning: **Deprecated** - Use `simplePathParameterObjects` instead. * [globalNameOverridden](docs/generation/README.md#globalnameoverridden) * [ignoredGenerationGet](docs/generation/README.md#ignoredgenerationget) * [ignoresPost](docs/generation/README.md#ignorespost) diff --git a/typescript-client-sdk/__tests__/responsebodies.test.ts b/typescript-client-sdk/__tests__/responsebodies.test.ts index 568241ce2..7e9bc0ea3 100755 --- a/typescript-client-sdk/__tests__/responsebodies.test.ts +++ b/typescript-client-sdk/__tests__/responsebodies.test.ts @@ -31,6 +31,9 @@ test("Response Body JSON Get", async () => { "Overview" ); expect(res.httpBinSimpleJsonObject?.slideshow.slides[1].type).toBe("all"); + expect(JSON.stringify(res.rawResponse?.data)).toBe( + '{"slideshow":{"author":"Yours Truly","date":"date of publication","slides":[{"title":"Wake up to WonderWidgets!","type":"all"},{"items":["Why WonderWidgets are great","Who buys WonderWidgets"],"title":"Overview","type":"all"}],"title":"Sample Slide Show"}}' + ); }); test("Response Body String Get", async () => { diff --git a/typescript-client-sdk/__tests__/telemetry.test.ts b/typescript-client-sdk/__tests__/telemetry.test.ts index e0449ca81..5737d9ea2 100755 --- a/typescript-client-sdk/__tests__/telemetry.test.ts +++ b/typescript-client-sdk/__tests__/telemetry.test.ts @@ -22,7 +22,7 @@ test("Test Telemetry User Agent Get", async () => { expect(res.statusCode).toBeDefined(); expect(res.statusCode).toBe(200); expect(res.res?.headers["X-Speakeasy-User-Agent"]).toBe( - "speakeasy-sdk/typescript 1.2.1 2.31.0" + "speakeasy-sdk/typescript 1.3.0 2.32.2" ); }); @@ -40,6 +40,6 @@ test("Test Telemetry Speakeasy User Agent Get", async () => { expect(res.statusCode).toBe(200); expect(res.res?.headers["User-Agent"]).toBe(userAgent); expect(res.res?.headers["X-Speakeasy-User-Agent"]).toBe( - "speakeasy-sdk/typescript 1.2.1 2.31.0" + "speakeasy-sdk/typescript 1.3.0 2.32.2" ); }); diff --git a/typescript-client-sdk/docs/generation/README.md b/typescript-client-sdk/docs/generation/README.md index 00ab2448c..4447b4cd9 100755 --- a/typescript-client-sdk/docs/generation/README.md +++ b/typescript-client-sdk/docs/generation/README.md @@ -9,7 +9,7 @@ Endpoints for purely testing valid generation behavior. * [anchorTypesGet](#anchortypesget) * [circularReferenceGet](#circularreferenceget) * [~~deprecatedNoCommentsGet~~](#deprecatednocommentsget) - :warning: **Deprecated** -* [~~deprecatedWithCommentsGet~~](#deprecatedwithcommentsget) - This is an endpoint setup to test deprecation with comments :warning: **Deprecated** +* [~~deprecatedWithCommentsGet~~](#deprecatedwithcommentsget) - This is an endpoint setup to test deprecation with comments :warning: **Deprecated** - Use `simplePathParameterObjects` instead. * [globalNameOverridden](#globalnameoverridden) * [ignoredGenerationGet](#ignoredgenerationget) * [ignoresPost](#ignorespost) @@ -93,7 +93,7 @@ sdk.generation.deprecatedNoCommentsGet("vero").then((res: DeprecatedNoCommentsGe This is an endpoint setup to test deprecation with comments -> :warning: **DEPRECATED**: this method will be removed in a future release, please migrate away from it as soon as possible. +> :warning: **DEPRECATED**: this method will be removed in a future release, please migrate away from it as soon as possible. Use `simplePathParameterObjects` instead. ### Example Usage diff --git a/typescript-client-sdk/gen.yaml b/typescript-client-sdk/gen.yaml index f4714b26b..ec2a8bc21 100755 --- a/typescript-client-sdk/gen.yaml +++ b/typescript-client-sdk/gen.yaml @@ -2,13 +2,13 @@ configVersion: 1.0.0 management: docChecksum: 76623f721a416be989cb70240cd8b7e1 docVersion: 0.0.1 - speakeasyVersion: 1.36.3 - generationVersion: 2.31.0 + speakeasyVersion: 1.37.5 + generationVersion: 2.32.2 generation: sdkClassName: SDK singleTagPerOp: false typescript: - version: 1.2.1 + version: 1.3.0 author: Speakeasy maxMethodParams: 5 packageName: openapi diff --git a/typescript-client-sdk/package-lock.json b/typescript-client-sdk/package-lock.json index 31fc1197b..3e9356478 100755 --- a/typescript-client-sdk/package-lock.json +++ b/typescript-client-sdk/package-lock.json @@ -1,12 +1,12 @@ { "name": "openapi", - "version": "1.2.1", + "version": "1.3.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "openapi", - "version": "1.2.1", + "version": "1.3.0", "dependencies": { "axios": "^1.1.3", "class-transformer": "^0.5.1", diff --git a/typescript-client-sdk/package.json b/typescript-client-sdk/package.json index 3227396ec..3ea3db615 100755 --- a/typescript-client-sdk/package.json +++ b/typescript-client-sdk/package.json @@ -1,6 +1,6 @@ { "name": "openapi", - "version": "1.2.1", + "version": "1.3.0", "author": "Speakeasy", "scripts": { "prepare": "tsc --build", diff --git a/typescript-client-sdk/src/sdk/generation.ts b/typescript-client-sdk/src/sdk/generation.ts index b5bf29f27..cd7c65980 100755 --- a/typescript-client-sdk/src/sdk/generation.ts +++ b/typescript-client-sdk/src/sdk/generation.ts @@ -188,7 +188,7 @@ export class Generation { /** * This is an endpoint setup to test deprecation with comments * - * @deprecated this method will be removed in a future release, please migrate away from it as soon as possible + * @deprecated this method will be removed in a future release, please migrate away from it as soon as possible. Use simplePathParameterObjects instead */ async deprecatedWithCommentsGet( deprecatedParameter?: string, diff --git a/typescript-client-sdk/src/sdk/models/operations/deprecatedwithcommentsget.ts b/typescript-client-sdk/src/sdk/models/operations/deprecatedwithcommentsget.ts index 17113fefe..c539a74f8 100755 --- a/typescript-client-sdk/src/sdk/models/operations/deprecatedwithcommentsget.ts +++ b/typescript-client-sdk/src/sdk/models/operations/deprecatedwithcommentsget.ts @@ -9,7 +9,7 @@ export class DeprecatedWithCommentsGetRequest extends SpeakeasyBase { /** * This is a string parameter * - * @deprecated this field will be removed in a future release, please migrate away from it as soon as possible + * @deprecated this field will be removed in a future release, please migrate away from it as soon as possible. Use newParameter instead */ @SpeakeasyMetadata({ data: "queryParam, style=form;explode=true;name=deprecatedParameter", diff --git a/typescript-client-sdk/src/sdk/sdk.ts b/typescript-client-sdk/src/sdk/sdk.ts index 8718de5ca..9c6cb60b3 100755 --- a/typescript-client-sdk/src/sdk/sdk.ts +++ b/typescript-client-sdk/src/sdk/sdk.ts @@ -127,8 +127,8 @@ export class SDK { public _securityClient: AxiosInstance; public _serverURL: string; private _language = "typescript"; - private _sdkVersion = "1.2.1"; - private _genVersion = "2.31.0"; + private _sdkVersion = "1.3.0"; + private _genVersion = "2.32.2"; private _globals: any; constructor(props?: SDKProps) {