Skip to content

[Java-Playframework] UUID parameter is not found #6609

@sparta15

Description

@sparta15
Description

If you have one a parameter as UUID inside you url, It's not found as parameter of the controller method and don't compile.

Swagger-codegen version

2.3.0 - SNAPSHOT

Swagger declaration file content or url

You can consult the example here

And this is the routes file generated:

# Routes
# This file defines all application routes (Higher priority routes first)
# ~~~~



#Functions for Awesome API
GET     /awesomeapi/v1/pets/:petId/stores/:id                     controllers.StoresApiController.getStore(petId: String, id: UUID)
GET     /awesomeapi/v1/pets/:petId/stores                     controllers.StoresApiController.listStores(petId: String)

# Map static resources from the /public folder to the /assets URL path
GET     /assets/*file               controllers.Assets.versioned(path="/public", file: Asset)

Whit this error:

[error] /localDirectory/petExample/store/target/scala-2.11/resource_managed/main/routes:8: not found: type UUID
[error] GET     /awesomeapi/v1/pets/:petId/stores/:id                   controllers.StoresApiController.getStore(petId: String, id: UUID)

Command line used for generation
Steps to reproduce

language JavaPlayFramework

Pull Request to resolve it

Resolve problem with UUID class not found if there is almost one parameter with format as uuid

Suggest a fix/enhancement

Change route.mustache adding java.util.UUID when the parameter will be UUID
Example:

GET     /awesomeapi/v1/pets/:petId/stores/id                     controllers.EventsApiController.getEvent(userId: String, id: java.util.UUID)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions