Created by: chrisbartoloburlo
Fixed multiple bugs present in the scala-sttp generator:
- The generated requests were using
Nothinginstead ofAnyas the capability parameter (as mentioned also here). Fixed by changing (api.mustache) to useAny. - When the
responsesinside 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
apipackage. Libraries such asSetused to be imported asorg.openapitools.client.model.Set, howeverSetwas not generated as a model. Now it imports the Scala standard libraryscala.collection.immutable.Setinstead.
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: Commit all changed files. This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master. These must match the expectations made by your contribution. You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example./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