Spring RestDoc を AsciiDoc と一緒に使用して、残りの API を記述しています。RestDoc は、記述された要求パラメーター/応答フィールドなどがあるかどうかに応じて、異なるファイルを生成します。存在するファイルを条件付きで含む 1 つのテンプレートが必要です。
このようなもの:
Request:
include::{reqresPath}/http-request.adoc[]
Response:
include::{reqresPath}/http-response.adoc[]
Parameters:
ifeval::[{{reqresPath}/request-parameters.adoc}.exists]
include::{reqresPath}/request-parameters.adoc[]
endif::[]
ifeval::[{{reqresPath}/request-parameters.adoc}.exists]
include::{reqresPath}/request-parameters.adoc[]
endif::[]
または、少なくともファイルが見つからない場合の警告を除外します。しかし、これらを抑制する方法がわかりませんでした。