Skip to content

Commit 5f28987

Browse files
authored
Adapted scala-sttp4-jsoniter to use orFail instead of getRight when using separateErrorChannel=false (#22536)
1 parent 0b296bf commit 5f28987

File tree

1 file changed

+1
-1
lines changed
  • modules/openapi-generator/src/main/resources/scala-sttp4-jsoniter

1 file changed

+1
-1
lines changed

modules/openapi-generator/src/main/resources/scala-sttp4-jsoniter/api.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ case class {{classname}}[Auth <: {{invokerPackage}}.Authorization] private (base
6767
{{>paramMultipartCreation}}{{/formParams}}
6868
).flatten){{/isMultipart}}{{/formParams.0}}{{#bodyParam}}
6969
{{^isFile}}.body(asJson({{paramName}})){{/isFile}}{{#isFile}}.fileBody({{paramName}}){{/isFile}}{{/bodyParam}}
70-
.response({{#separateErrorChannel}}{{^returnType}}asString.mapWithMetadata(ResponseAs.deserializeRightWithError(_ => Right(()))){{/returnType}}{{#fnHandleDownload}}{{#returnType}}asJson[{{>operationReturnType}}]{{/returnType}}{{/fnHandleDownload}}{{/separateErrorChannel}}{{^separateErrorChannel}}{{^returnType}}asString.mapWithMetadata(ResponseAs.deserializeRightWithError(_ => Right(()))).getRight{{/returnType}}{{#returnType}}asJson[{{>operationReturnType}}].getRight{{/returnType}}{{/separateErrorChannel}})
70+
.response({{#separateErrorChannel}}{{^returnType}}asString.mapWithMetadata(ResponseAs.deserializeRightWithError(_ => Right(()))){{/returnType}}{{#fnHandleDownload}}{{#returnType}}asJson[{{>operationReturnType}}]{{/returnType}}{{/fnHandleDownload}}{{/separateErrorChannel}}{{^separateErrorChannel}}{{^returnType}}asString.mapWithMetadata(ResponseAs.deserializeRightWithError(_ => Right(()))).orFail{{/returnType}}{{#returnType}}asJson[{{>operationReturnType}}].orFail{{/returnType}}{{/separateErrorChannel}})
7171
7272
{{/operation}}
7373
{{/operations}}

0 commit comments

Comments
 (0)