2 Answers
- Newest
- Most votes
- Most comments
0
Resolved using this syntax
bodyHtml:
oneOf:
- type: string
- type: 'null'
answered 2 years ago
-1
That is a support issue.... API Gateway validator does not fully support the nullable attribute of the OpenAPI specification. While nullable: true is valid in OpenAPI, API Gateway might not interpret it correctly, causing it to expect a string value instead of allowing null.
As a workaround, you could consider changing the type of bodyHtml to an array that can contain either a string or null, like so:
bodyHtml:
type: array
items:
type: string
minItems: 0
maxItems: 1
Relevant content
- asked 6 years ago
- asked 5 years ago
- AWS OFFICIALUpdated a year ago

HI i think it's not the right answer. I tried to modify the model manually from the api gateway aws console and i found the right syntax
Now the problem is that i didn't know how to report the model in my yaml cloudformation template.
I tried with as mentioned here https://www.openapis.org/blog/2021/02/16/migrating-from-openapi-3-0-to-3-1-0 bodyHtml: type: - string - 'null'
But cloudformation says [/Resources/IntStoreRestApi/Type/Body/components/schemas/Article/properties/bodyHtml/type/1] 'null' values are not allowed in templates