Created by: cyangle
@wing328 This PR mainly refactored how it handles nillable and nullable types and default values. I got some ideas from the kotlin-client sample code The breaking change is the requirement of keyword argument invoking style of methods which is needed to support setting default values last in order is required for setting default values to positional params but it's not required in keyword args
There are other minor fixes. Check the details listed below, and you should also check the commit messages.
- Refactor methods to use keyword args if the method has more than one param
- Add default values to method definitions and model initializers
- Add boolean flag
hasOnlyOneParam
- sets to true when the method has only one param - Handle empty collection param
- Handle conversion to string from non file and non string types
- Refactor model with nilable types - Inspiration from kotlin-client code samples
- Refactor model initializers to support only keyword args
- Add profile crystal-client to pom.xml
- Clean up gitignore.mustache
- Change deprecated URI.encode to URI.encode_path
- Fix tests in file samples/client/petstore/crystal/spec/api/pet_api_spec.cr
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.