rajr/go-swagger
FROM golang:1.10.3-alpine3.7
MAINTAINER RajR
RUN apk add bash
ADD https://github.com/go-swagger/go-swagger/releases/download/0.14.0/swagger_linux_amd64 /usr/bin/swagger
RUN chmod +x /usr/bin/swagger
WORKDIR /go/src
CMD ["swagger"]
$ mkdir gen
$ docker run -it --rm -v $(pwd):/go/src/helloworld_app -w /go/src/helloworld_app rajr/go-swagger \
> swagger generate server --exclude-main -A helloworld -t gen -f swagger.yaml
$ mkdir gen
$ docker run -it --rm -v $(pwd):/go/src/helloworld_app -w /go/src/helloworld_app rajr/go-swagger \
> swagger generate client -A helloworld -t gen -f ./models/swagger/swagger.yaml
$ ls
hello-world.yang swagger.yaml
$ mkdir gen
$ docker run -it --rm -v $(pwd):/go/src/helloworld_app -w /go/src/helloworld_app rajr/go-swagger \
> swagger generate server --exclude-main -A helloworld -t gen -f swagger.yaml
$ ls -R
.:
gen hello-world.yang swagger.yaml
./gen:
models restapi
./gen/models:
get_helloworld_helloworld_o_k_body.go patch_helloworld_helloworld_params_body.go put_helloworld_helloworld_params_body.go
patch_helloworld_helloworld_o_k_body.go put_helloworld_helloworld_o_k_body.go
./gen/restapi:
configure_helloworld.go doc.go embedded_spec.go operations server.go
./gen/restapi/operations:
helloworld helloworld_api.go
./gen/restapi/operations/helloworld:
delete_helloworld_helloworld.go get_helloworld_helloworld.go patch_helloworld_helloworld.go put_helloworld_helloworld.go
delete_helloworld_helloworld_parameters.go get_helloworld_helloworld_parameters.go patch_helloworld_helloworld_parameters.go put_helloworld_helloworld_parameters.go
delete_helloworld_helloworld_responses.go get_helloworld_helloworld_responses.go patch_helloworld_helloworld_responses.go put_helloworld_helloworld_responses.go
delete_helloworld_helloworld_urlbuilder.go get_helloworld_helloworld_urlbuilder.go patch_helloworld_helloworld_urlbuilder.go put_helloworld_helloworld_urlbuilder.go
$
docker pull rajr/go-swagger