loic911 / Rest-api-doc

MIT License
21 stars 32 forks source link

Query Parameters do not work in playground #13

Closed kimifoud closed 10 years ago

kimifoud commented 10 years ago

The query parameters do not seem to work in playground. The Query Parameters widget gets rendered correctly, but the URL called on submit is always the base url without the parameters - http://localhost:8080/api/search in my case.

@RestApi(name = "User search", description = "API for searching users")
class SearchController {

    @RestApiMethod(description = "Search interface.", path = "/search", verb = RestApiVerb.GET, listing = true)
    @RestApiParams(params = [
    @RestApiParam(name = "birthday", format = "yyyy-MM-dd", type = "string", paramType = RestApiParamType.QUERY, description = "Minimum start date, inclusive.", required = false),
    @RestApiParam(name = "serviceId", type = "integer", paramType = RestApiParamType.QUERY, description = "Service ID", required = true),
    @RestApiParam(name = "language", type = "string", paramType = RestApiParamType.QUERY, description = "User's language", required = false)
    ])
    @RestApiResponseObject(objectIdentifier = "[user]", multiple = "true")
    def search() {
        // parse params etc
        render results as JSON
    }
}
loic911 commented 10 years ago

Thanks, It will work in 0.3 (coming soon).