Expected Behaviour
After run get_openapi_json_schema() which will auto generate examples in response of 404.
Current Behaviour
In Amazon Bedrock Agents, I want to create multiple example JSON for a HTTP response. But when I add examples element in Post or Get method, it is renamed to "example" (non suffix 's') in JSON Schema
@app.post(
"/check_data",
responses={
404: {
"description": "Data not found or don't match ",
"content": {
"application/json": {
"schema": ResErrorBody.model_json_schema(),
"examples": {
"PolicyNotFoundCase1": {
"summary": "error case 1",
"description": "404 case 1.",
"value": {
"error-code": "ERROR-404-NOT-FOUND",
"message": "01",
}
},
"PolicyNotFoundCase2": {
"summary": "error case 2",
"description": "404 case 2.",
"value": {
"error-code": "ERROR-404-NOT-FOUND",
"message": "01",
"tool-name": "test"
}
}
}
}
}
},
422: {
"description": "Validation Error"
# ...
}
}
)
Code snippet
@app.post(
"/check_data",
responses={
404: {
"description": "Data not found or don't match ",
"content": {
"application/json": {
"schema": ResErrorBody.model_json_schema(),
"examples": {
"PolicyNotFoundCase1": {
"summary": "error case 1",
"description": "404 case 1.",
"value": {
"error-code": "ERROR-404-NOT-FOUND",
"message": "01",
}
},
"PolicyNotFoundCase2": {
"summary": "error case 2",
"description": "404 case 2.",
"value": {
"error-code": "ERROR-404-NOT-FOUND",
"message": "01",
"tool-name": "test"
}
}
}
}
}
}
}
)
Possible Solution
No response
Steps to Reproduce
In Amazon Bedrock Agents, white code to create a OpenAPI-based Actions with POST or GET method
Powertools for AWS Lambda (Python) version
3.20.0
AWS Lambda function runtime
3.9
Packaging format used
Lambda Layers
Debugging logs
Expected Behaviour
After run
get_openapi_json_schema()which will auto generateexamplesin response of 404.Current Behaviour
In Amazon Bedrock Agents, I want to create multiple example JSON for a HTTP response. But when I add
exampleselement in Post or Get method, it is renamed to "example" (non suffix 's') in JSON SchemaCode snippet
Possible Solution
No response
Steps to Reproduce
In Amazon Bedrock Agents, white code to create a OpenAPI-based Actions with POST or GET method
Powertools for AWS Lambda (Python) version
3.20.0
AWS Lambda function runtime
3.9
Packaging format used
Lambda Layers
Debugging logs