swagger-api / swagger-api/swagger-codegen
[Groovy] Gradle build error
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
When running gradle test with Groovy Pestore client, we get the following errors:
$ gradle test
:compileJava UP-TO-DATE
:compileGroovy
startup failed:
/Users/williamcheng/Code/jan2017/swagger-codegen/samples/client/petstore/groovy/src/main/groovy/io/swagger/api/PetApi.groovy: 8: unable to resolve class io.swagger.model.File
@ line 8, column 1.
import io.swagger.model.File
^
/Users/williamcheng/Code/jan2017/swagger-codegen/samples/client/petstore/groovy/src/main/groovy/io/swagger/api/StoreApi.groovy: 8: unable to resolve class io.swagger.model.Map
@ line 8, column 1.
import io.swagger.model.Map
^
/Users/williamcheng/Code/jan2017/swagger-codegen/samples/client/petstore/groovy/src/main/groovy/io/swagger/model/Order.groovy: 6: unable to resolve class io.swagger.model.Date
@ line 6, column 1.
import io.swagger.model.Date;
^
/Users/williamcheng/Code/jan2017/swagger-codegen/samples/client/petstore/groovy/src/main/groovy/io/swagger/model/Pet.groovy: 6: unable to resolve class io.swagger.model.ArrayList
@ line 6, column 1.
import io.swagger.model.ArrayList;
^
4 errors
Swagger-codegen version
Latest master
Steps to reproduce
cd samples/client/petstore/groovy && gradle test
Suggest a Fix
The issue probably has to do with type mapping for File, Map, Date and ArrayList so we will need to revise the primitive type as well as type mapping for Groovy generator. (one may also find the fix in
the Abstract Java generator)
If anyone wants to work on this fix, please reply to let us know.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in samples/client/petstore/groovy and run gradle test to reproduce the four unresolved imports. Then inspect the Groovy generator's type mapping and compare it with the Abstract Java generator, as suggested in the issue; done means the generated Groovy client compiles and its tests pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- groovy
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100