diff --git a/content/posts/2023-10-06/index.md b/content/posts/2023-10-06/index.md new file mode 100644 index 0000000..acb1787 --- /dev/null +++ b/content/posts/2023-10-06/index.md @@ -0,0 +1,44 @@ +--- +author: usbharu +draft: false +categories: + - 技術 +date: 2023-10-06T12:05:47+09:00 +tags: + - OpenAPI + - Kotlin + - SpringBoot + - Mustache +keywords: + - OpenAPI + - Kotlin + - SpringBoot + - Mustache +title: OpenAPI Generatorで使われてるmustacheで配列のindexを得る +relpermalink: posts/2023-10-06/ +url: posts/2023-10-06/ +decription: OpenAPI Generatorで使われてるmustacheで配列のindexを得る +--- + +ハゲそうになったので誰かの役に立ったらとここに書いておく + +`-index`を使う + +```mustache +{{#list}} +{{-index}} +{{/list}} +``` + +# OpenAPI Generator で使われているのは mustache.java ではない + +OpenAPI Generator で使われているのは mustache.java ではありません。 +なので拡張記法として有名なものは使用できません。 + +使用されているのは jmustache というもので一部に独自の記法が存在します。 + +## 配列等で index を得るには-index を使う + +https://github.com/samskivert/jmustache#-index + +ここに書いてあるとおりです。