NOTE: Sashay development has been on hold for a while due to affairs of state. In the meantime, go-swagger has surfaced, supporting Swagger 2.0. I've also been getting a lot of use out of swagger, which provides the other end of the rope by generating a Swagger spec from code and providing a web interface. I recommend that you review these tools if you need Swagger 2.0 rather than holding your breath for me to update Sashay to 2.0.

Sashay is a code generator for the Go programming language. The purpose of Sashay is to make writing programs that interact with RESTful services easier by automating the generation of boilerplate code.

Sashay reads a Swagger v1.2 specification and builds a library for interfacing with that Swagger service, including all defined data types and structures.


go get bitbucket.org/seanerussell/sashay/cmd/sashay

Dependencies ~~~~

If you encounter any compile problems related to dependencies, grab https://github.com/tools/godep[godep] and use it to build the application.

go get -d -u bitbucket.org/seanerussell/sashay/cmd/sashay
godep go install .

Tools like godep, gpm, and gvp greatly simplify the care and feeding of Go software.


sashay <-f> <-u> <-p>
    -f="": API specification JSON file
    -p="": API package
    -u="": API specification URL

Either -f or -u must be provided, and only one can be. -p must be provided.


sashay -u http://petstore.swagger.wordnik.com/api/api-docs -p petstore > petstore.go

will generate a Go library called "petstore" which can be imported and used to interact with the Swagger sample application. Use this generated library like this;

package main

import "petstore"

func main() {
    pet, err := petstore.GetPetById(33)
    if err != nil {
        log.Println("error fetching pet:", err.Error())
    log.Println("Pet's name is", pet.Name)


This software is released under the BSD Simplified license. See the included file LICENSE.txt