LoginSignup
0
0

More than 5 years have passed since last update.

apiblueprint のパラメーター内の記述で "-"(ハイフン) を使うとき

Last updated at Posted at 2017-10-01

APIBlueprint を試しがてら使っているのですが、-(ハイフン)が入った値をパラメーターのサンプル値として設定するときに思ったような挙動をしなかったのでメモします。

+ Parameters 
  + sample1: sample1_val (string, optional) - サンプル1
  + sample2: sample2-val (string, optional) - サンプル2

みたいな記述をしたときに、 sample2 の方がなぜか reuired で出力されてしまいます。

これはどうも ハイフン が原因のようで、ハイフン を使うときは `(バッククォート)で括らないといかんみたいです。

なので、

+ Parameters 
  + sample1: sample1_val (string, optional) - サンプル1
  + sample2: `sample2-val` (string, optional) - サンプル2

とやれば大丈夫です。

リファレンスに書いてありそう。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0