Swagger (2.0) では、 path と operation から response の型が一意に決まる

Published: 2019/11/26


https://swagger.io/docs/specification/2-0/paths-and-operations/

上記のページを読んでいて、そこに以下のような記述があった。

This is because Swagger considers a unique operation as a combination of a path and the HTTP method, and additional parameters do not make the operation unique.

また、次のページには、以下のような記述がある。

https://swagger.io/docs/specification/2-0/describing-responses/

Can I have different responses based on a request parameter? No.

というわけで、 swagger の、少なくとも 2.0 時点では、 path と operation を定めたら、 response の型は一意に定まるように設計するべき。


Tags: swagger

関連記事