Closed kimifoud closed 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.
http://localhost:8080/api/search
@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 } }
Thanks, It will work in 0.3 (coming soon).
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.