[ANN] Sashay: a Go language code generator for Swagger services

32 views
Skip to first unread message

Sean Russell

unread,
Apr 16, 2014, 6:54:20 AM4/16/14
to swagger-sw...@googlegroups.com
Hi,

I've released v0.9 of Sashay, a Go code generator for REST services that expose a Swagger specification.

Go is a systems-oriented, procedural, garbage-collected, natively compiled, and concurrent programming language being developed by people at Google.

Example:

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())
        return
    }
    log.Println("Pet's name is", pet.Name)
}

Caveats in this version
:
  • Large swaths are untested with live services.  There will be bugs.
  • Authentication is not yet implemented.  The next release will begin to include auth support.

I'm releasing it early and unfinished in the hopes that it will remove some boilerplate effort for somebody and thereby prove useful even if it fails to completely remove the need to write code for interacting with services.  Feel free to file bugs here.

Cheers,

--- SER

tony tam

unread,
May 2, 2014, 5:13:29 PM5/2/14
to swagger-sw...@googlegroups.com
This is really awesome.  Thanks for sharing!
Reply all
Reply to author
Forward
0 new messages