Skip to content

Instantly share code, notes, and snippets.

@tkhk
Last active June 9, 2020 06:01
Show Gist options
  • Save tkhk/058878dbf736af180036207a4cf39c25 to your computer and use it in GitHub Desktop.
Save tkhk/058878dbf736af180036207a4cf39c25 to your computer and use it in GitHub Desktop.
OpenAPI (OpenAPI Generator) 使う時の注意点
  • components は global におく必要がある
  • Schema オブジェクトは title をつけないと, InlineObject${index} のような名前が付けられる
  • csrf のトークンが必要な場合、Configuration で設定(下記参照)
  • 本番・開発環境で URL 変更したい場合、Configuration で設定(下記参照)
const config = new Configuration({
  basePath: 'http://localhost:3000/api',
  headers: {
    "x-csrf-token": document.head.querySelector("meta[name~=csrf-token][content]"))?.content
  }
})
  • content-type によってリクエスト関数の引数 type: object が平坦化されることがある
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment