generated from amazon-archives/__template_MIT-0
-
Notifications
You must be signed in to change notification settings - Fork 455
Labels
bugSomething isn't workingSomething isn't working
Description
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
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
Coming soon