Skip to content

Instantly share code, notes, and snippets.

@GET
@Path("/findByStatus")
@ApiOperation(value = "Finds Pets by status",
notes = "Multiple status values can be provided with comma seperated strings",
responseClass = "com.wordnik.swagger.sample.model.Pet", multiValueResponse = true)
@ApiErrors(Array(
new ApiError(code = 400, reason = "Invalid status value")))
def findPetsByStatus(
@ApiParam(value = "Status values that need to be considered for filter", required = true, defaultValue = "available",
allowableValues = "available,pending,sold", allowMultiple = true)@QueryParam("status") status: String) = {
package com.wordnik.client
import com.wordnik.client.api._
import com.wordnik.client.model._
import com.wordnik.swagger.runtime.common._
object Test {
def main(args: Array[String]) = {
val securityHandler = new ApiKeyAuthTokenBasedSecurityHandler("{YOUR_KEY}", null)
# process for creating a scala library for a swagger-enabled server
# build the codegen
ant
# generate the client library with the default (empty) api_key
./bin/generate-scala-lib.sh http://api.wordnik.com/v4 "" com.wordnik.client generated
# copy the sample build script
cp conf/scala/sample/* generated/