API Blueprintでパラメータにハイフン(-)が含まれる場合にハイフン以降が出力されない
はじめに
API Blueprint でクエリパラメータをつけるエンドポイントを定義したかったけど、出力されたフォーマットが想定していたものと違っていた時の備忘録
修正前
http://example.com/api/example?date=2000-01-10 みたいなURIを想定して、以下のように書いた(一部抜粋)
## サンプル [/api/example{?date}]
### 取得 [GET]
+ Parameters
+ date: 2000-01-10 (string) - 対象年月日
aglio を使って出力されたもの

2000で切れてる....!!!!
修正後
値をバッククォートで囲ってあげればいい
## サンプル [/api/example{?date}]
### 取得 [GET]
+ Parameters
+ date: `2000-01-10` (string) - 対象年月日

ハイフン以降も表示されました
ドキュメントにもちゃんと書いてありました
NOTE: It's important to note, that if a key or value contains reserved characters such as :, (,), <, >, {, }, [, ], _, *, -, +, ` then the value must be wrapped in a code-block using back-ticks.