'Validate path param in AWS API Gateway through OpenAPI spec
I created a POST API with path parameter and request body through openAPI spec.
"/v2/{lang}/subject": {
"post": {
"parameters": [
{
"name": "lang",
"in": "path",
"required": true,
"type": "string"
},
{
"in": "body",
"name": "subject",
"required": true,
"schema": {
"$ref": "#/definitions/subject"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/subject"
}
}
},
"required": true
},
"x-amazon-apigateway-request-validator" : "all",
.....
}
I want to validate path param and request body at APIGW. Unfortunately, 1 test case is failing.
If I try accessing API with missing lang, ex: https://apigwsampleurl.com/v2/subject, AWS APIGW is throwing Missing Authentication Token error.
How this case should be handled in the configuration?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
