diff --git a/.gitignore b/.gitignore index 677ea60..ca85136 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,5 @@ _testmain.go bindata.go /_example/_example +/_example/go.mod +/_example/go.sum diff --git a/_example/docs/company.apib b/_example/docs/company.apib index f1b4ec1..18bf959 100644 --- a/_example/docs/company.apib +++ b/_example/docs/company.apib @@ -10,7 +10,7 @@ Create a new company + Request company (application/json; charset=utf-8) + Headers - Accept: application/vnd.wantedly+json + Accept: application/vnd.shimastripe+json + Attributes + name: NAME (string) @@ -27,7 +27,7 @@ Returns a company list. + Request (application/json; charset=utf-8) + Headers - Accept: application/vnd.wantedly+json + Accept: application/vnd.shimastripe+json + Response 200 (application/json; charset=utf-8) + Attributes (array, fixed) @@ -49,7 +49,7 @@ Returns a company. + Request (application/json; charset=utf-8) + Headers - Accept: application/vnd.wantedly+json + Accept: application/vnd.shimastripe+json + Response 200 (application/json; charset=utf-8) + Attributes (company, fixed) @@ -61,7 +61,7 @@ Update a company. + Request company (application/json; charset=utf-8) + Headers - Accept: application/vnd.wantedly+json + Accept: application/vnd.shimastripe+json + Attributes + name: NAME (string) @@ -78,7 +78,7 @@ Delete a company. + Request (application/json; charset=utf-8) + Headers - Accept: application/vnd.wantedly+json + Accept: application/vnd.shimastripe+json + Response 204 diff --git a/_example/docs/email.apib b/_example/docs/email.apib index ef14211..49e42fc 100644 --- a/_example/docs/email.apib +++ b/_example/docs/email.apib @@ -10,7 +10,7 @@ Create a new email + Request email (application/json; charset=utf-8) + Headers - Accept: application/vnd.wantedly+json + Accept: application/vnd.shimastripe+json + Attributes + address: ADDRESS (string) @@ -27,7 +27,7 @@ Returns an email list. + Request (application/json; charset=utf-8) + Headers - Accept: application/vnd.wantedly+json + Accept: application/vnd.shimastripe+json + Response 200 (application/json; charset=utf-8) + Attributes (array, fixed) @@ -49,7 +49,7 @@ Returns an email. + Request (application/json; charset=utf-8) + Headers - Accept: application/vnd.wantedly+json + Accept: application/vnd.shimastripe+json + Response 200 (application/json; charset=utf-8) + Attributes (email, fixed) @@ -61,7 +61,7 @@ Update an email. + Request email (application/json; charset=utf-8) + Headers - Accept: application/vnd.wantedly+json + Accept: application/vnd.shimastripe+json + Attributes + address: ADDRESS (string) @@ -78,7 +78,7 @@ Delete an email. + Request (application/json; charset=utf-8) + Headers - Accept: application/vnd.wantedly+json + Accept: application/vnd.shimastripe+json + Response 204 diff --git a/_example/docs/job.apib b/_example/docs/job.apib index d5c12ae..c135bb9 100644 --- a/_example/docs/job.apib +++ b/_example/docs/job.apib @@ -10,7 +10,7 @@ Create a new job + Request job (application/json; charset=utf-8) + Headers - Accept: application/vnd.wantedly+json + Accept: application/vnd.shimastripe+json + Attributes + user_id: 1 (number) @@ -28,7 +28,7 @@ Returns a job list. + Request (application/json; charset=utf-8) + Headers - Accept: application/vnd.wantedly+json + Accept: application/vnd.shimastripe+json + Response 200 (application/json; charset=utf-8) + Attributes (array, fixed) @@ -50,7 +50,7 @@ Returns a job. + Request (application/json; charset=utf-8) + Headers - Accept: application/vnd.wantedly+json + Accept: application/vnd.shimastripe+json + Response 200 (application/json; charset=utf-8) + Attributes (job, fixed) @@ -62,7 +62,7 @@ Update a job. + Request job (application/json; charset=utf-8) + Headers - Accept: application/vnd.wantedly+json + Accept: application/vnd.shimastripe+json + Attributes + user_id: 1 (number) @@ -80,7 +80,7 @@ Delete a job. + Request (application/json; charset=utf-8) + Headers - Accept: application/vnd.wantedly+json + Accept: application/vnd.shimastripe+json + Response 204 diff --git a/_example/docs/profile.apib b/_example/docs/profile.apib index 042d2c9..b3537a3 100644 --- a/_example/docs/profile.apib +++ b/_example/docs/profile.apib @@ -10,7 +10,7 @@ Create a new profile + Request profile (application/json; charset=utf-8) + Headers - Accept: application/vnd.wantedly+json + Accept: application/vnd.shimastripe+json + Attributes + user_id: 1 (number) @@ -28,7 +28,7 @@ Returns a profile list. + Request (application/json; charset=utf-8) + Headers - Accept: application/vnd.wantedly+json + Accept: application/vnd.shimastripe+json + Response 200 (application/json; charset=utf-8) + Attributes (array, fixed) @@ -50,7 +50,7 @@ Returns a profile. + Request (application/json; charset=utf-8) + Headers - Accept: application/vnd.wantedly+json + Accept: application/vnd.shimastripe+json + Response 200 (application/json; charset=utf-8) + Attributes (profile, fixed) @@ -62,7 +62,7 @@ Update a profile. + Request profile (application/json; charset=utf-8) + Headers - Accept: application/vnd.wantedly+json + Accept: application/vnd.shimastripe+json + Attributes + user_id: 1 (number) @@ -80,7 +80,7 @@ Delete a profile. + Request (application/json; charset=utf-8) + Headers - Accept: application/vnd.wantedly+json + Accept: application/vnd.shimastripe+json + Response 204 diff --git a/_example/docs/user.apib b/_example/docs/user.apib index e3fe39d..7a9395d 100644 --- a/_example/docs/user.apib +++ b/_example/docs/user.apib @@ -10,7 +10,7 @@ Create a new user + Request user (application/json; charset=utf-8) + Headers - Accept: application/vnd.wantedly+json + Accept: application/vnd.shimastripe+json + Attributes + name: NAME (string) @@ -28,7 +28,7 @@ Returns an user list. + Request (application/json; charset=utf-8) + Headers - Accept: application/vnd.wantedly+json + Accept: application/vnd.shimastripe+json + Response 200 (application/json; charset=utf-8) + Attributes (array, fixed) @@ -50,7 +50,7 @@ Returns an user. + Request (application/json; charset=utf-8) + Headers - Accept: application/vnd.wantedly+json + Accept: application/vnd.shimastripe+json + Response 200 (application/json; charset=utf-8) + Attributes (user, fixed) @@ -62,7 +62,7 @@ Update an user. + Request user (application/json; charset=utf-8) + Headers - Accept: application/vnd.wantedly+json + Accept: application/vnd.shimastripe+json + Attributes + name: NAME (string) @@ -80,7 +80,7 @@ Delete an user. + Request (application/json; charset=utf-8) + Headers - Accept: application/vnd.wantedly+json + Accept: application/vnd.shimastripe+json + Response 204 diff --git a/apig/testdata/docs/user.apib b/apig/testdata/docs/user.apib index 34c585f..7e3a87b 100644 --- a/apig/testdata/docs/user.apib +++ b/apig/testdata/docs/user.apib @@ -10,7 +10,7 @@ Create a new user + Request user (application/json; charset=utf-8) + Headers - Accept: application/vnd.wantedly+json + Accept: application/vnd.shimastripe+json + Attributes + name: NAME (string) @@ -25,7 +25,7 @@ Returns an user list. + Request (application/json; charset=utf-8) + Headers - Accept: application/vnd.wantedly+json + Accept: application/vnd.shimastripe+json + Response 200 (application/json; charset=utf-8) + Attributes (array, fixed) @@ -47,7 +47,7 @@ Returns an user. + Request (application/json; charset=utf-8) + Headers - Accept: application/vnd.wantedly+json + Accept: application/vnd.shimastripe+json + Response 200 (application/json; charset=utf-8) + Attributes (user, fixed) @@ -59,7 +59,7 @@ Update an user. + Request user (application/json; charset=utf-8) + Headers - Accept: application/vnd.wantedly+json + Accept: application/vnd.shimastripe+json + Attributes + name: NAME (string) @@ -74,7 +74,7 @@ Delete an user. + Request (application/json; charset=utf-8) + Headers - Accept: application/vnd.wantedly+json + Accept: application/vnd.shimastripe+json + Response 204 diff --git a/go.mod b/go.mod index dbd6212..72f329d 100644 --- a/go.mod +++ b/go.mod @@ -15,5 +15,4 @@ require ( github.com/mattn/go-isatty v0.0.0-20151211000621-56b76bdf51f7 // indirect github.com/onsi/ginkgo v1.16.5 // indirect github.com/onsi/gomega v1.17.0 // indirect - golang.org/x/sys v0.0.0-20210423082822-04245dca01da // indirect ) diff --git a/script/generation_test.sh b/script/generation_test.sh index 9068608..5ea7de5 100755 --- a/script/generation_test.sh +++ b/script/generation_test.sh @@ -13,7 +13,8 @@ if [[ ! $(git status . | grep 'nothing to commit') ]]; then fi echo "===> Building API server..." -go get ./... +go mod init +go mod tidy go build if [[ $? -gt 0 ]]; then