How to validate request path parameters for API Gateway in OpenAPI definition

0

Currently, there is a way to validate headers, query parameters, and the request body using a validator. But there isn't a way to do this validation for request path parameters.

The same question has been asked in the thread https://forums.aws.amazon.com/thread.jspa?threadID=267060 from 2017.

However, there hasn't been an answer in that thread. So my question would be: is there a way to validate request path parameters in API Gateway similar to how we validate headers, query parameters, and the request body?

Thank you

2回答
0
承認された回答

It is still not possible to validate the format of path parameters, only their existence. You will need to validate the format in the integration.

profile pictureAWS
エキスパート
Uri
回答済み 2年前
0

Hi there, perhaps I'm not fully understanding your question, however if there path is incorrect, there won't be an API Gateway resource on the back end to hit so any validation on that path would need to happen client side. I'm not aware of any option in the OpenApi definition to add validation on the path parameters.

回答済み 2年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ