Created by: chrisbartoloburlo
Fixed multiple bugs present in the scala-sttp generator:
- The generated requests were using
Nothing
instead ofAny
as the capability parameter (as mentioned also here). Fixed by changing (api.mustache) to useAny
. - When the
responses
inside a swagger file were specified asdefault
, the code generated was erroneous. In particular, the returned value used to be generated asasJson[Unit]
which caused a matching error at runtime. Fixed by updating the return value toasEither(asString, ignore)
and the corresponding return type of the generated function as indicated by the sttp contributors here. -
3bc4895 fixes imported libraries in the generated
api
package. Libraries such asSet
used to be imported asorg.openapitools.client.model.Set
, howeverSet
was not generated as a model. Now it imports the Scala standard libraryscala.collection.immutable.Set
instead.
https://github.com/OpenAPITools/openapi-generator/pull/11949#issuecomment-1082813214 I believe this schema.yaml.zip file reproduces all the errors mentioned above.
PR checklist
-
Read the contribution guidelines. -
Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community. -
Run the following to build the project and update samples: ./mvnw clean package ./bin/generate-samples.sh ./bin/utils/export_docs_generators.sh
./bin/generate-samples.sh bin/configs/java*
. For Windows users, please run the script in Git BASH. -
File the PR against the correct branch: master
(5.3.0),6.0.x
-
If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request. @chameleon82