Skip to content

Commit

Permalink
サーバURLの統一とパス調整/パラメータ追加 (#9)
Browse files Browse the repository at this point in the history
* サーバURLの統一とパス調整/パラメータ追加

- サーバURLを'https://secure.sakura.ad.jp/cloud/zone/is1a/api/objectstorage/1.0'に統一
- 従来のサーバURLの一部を各パスに移動
- 各パスでのサーバURLオーバーライドを廃止
- site_nameパラメータを追加
- operationIdを追加

* swagger.yamlの修正点についてドキュメントに追記
  • Loading branch information
yamamoto-febc authored Feb 27, 2022
1 parent 0cbb1bb commit 2f480e3
Show file tree
Hide file tree
Showing 7 changed files with 1,248 additions and 865 deletions.
1 change: 0 additions & 1 deletion .spectral.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ extends: spectral:oas
rules:
info-contact: false
operation-tag-defined: false
operation-operationId: false
path-keys-no-trailing-slash: false
oas3-server-trailing-slash: false
4 changes: 2 additions & 2 deletions apis/v1/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
v1 "github.com/sacloud/object-storage-api-go/apis/v1"
)

var serverURL = "https://secure.sakura.ad.jp/cloud/zone/is1a/api/objectstorage/1.0/fed/v1/"
var serverURL = "https://secure.sakura.ad.jp/cloud/zone/is1a/api/objectstorage/1.0"

// Example API定義から生成されたコードを直接利用する例
func Example() {
Expand All @@ -42,7 +42,7 @@ func Example() {
panic(err)
}

sites, err := client.GetClustersWithResponse(context.Background())
sites, err := client.ListClustersWithResponse(context.Background())
if err != nil {
panic(err)
}
Expand Down
7 changes: 6 additions & 1 deletion apis/v1/spec/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
オリジナルの定義ファイルは以下のサイトで公開されています。
[https://manual.sakura.ad.jp/cloud/objectstorage/api/api-json.html](https://manual.sakura.ad.jp/cloud/objectstorage/api/api-json.html)

公開されている定義ファイルのままではlintでエラーになる箇所があるため、手作業で修正しています
公開されている定義ファイルのままではlintでエラーになる箇所やoapi-codegenで扱いにくい箇所があるため手作業で修正しています
修正は以下のように行っています。

- オリジナルの定義ファイルをダウンロード、`original-swagger.json`として保存
Expand Down Expand Up @@ -49,3 +49,8 @@
- 修正前:`^[\w\d\/]{40}$`
- 修正後:`^[\w\d\/]{1,40}$`
`components.schemas.AccessKeyID`と同じ

### その他の修正点

- [サーバURLを`https://secure.sakura.ad.jp/cloud/zone/is1a/api/objectstorage/1.0`に統一](https://github.com/sacloud/object-storage-api-go/pull/9)
- [各操作に`operationId`を付与](https://github.com/sacloud/object-storage-api-go/pull/9)
Loading

0 comments on commit 2f480e3

Please sign in to comment.