Api Gateway - support for allOf & oneOf

1

As per this documentation https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-known-issues.html#api-gateway-known-issues-rest-apis , it mentions there's no support for oneOf property when defining API specs with OpenAPI 3.0.

There's no mentioning of the allOf property, but support for it seems to be partial: if I compose the root schema model with allOf, the corresponding endpoint will end up with no model attached to the request body at the API GW side. However, if I define some sub-property of the root model with allOf, that seems to work.

Example (hand written yaml so indentations not correct, but you'll get the idea):

schemas:
  # This does not work
  NotWorkingModel:
    allOf:
      - type: object
        properties:
          foo:
            type: string
       - type: object
         properties:
           bar:
             type: string
   
   # This works
   WorkingModel:
     type: object
     properties:
       foo:
         allOf:
            - type: object
               properties:
                 bar:
                   type: string
            - type: object
               properties:
                  jar:
                    type: string

My main question is: will there be any plans getting these oneOf & allOf properties fully supported when defining REST API specs with OpenAPI?

l3p1
asked a year ago285 views
1 Answer
3
Accepted Answer

Hello,

This is still an active feature request we have with the API Gateway internal team for which we currently do not have an ETA, unfortunately. You can keep an eye on the AWS What's New page and the API Gateway blog, as all new feature requests and enhancements are posted there.

 - AWS blogs: https://blogs.amazon.com/
 - What's New: https://aws.amazon.com/new/
 - AWS Release Notes: https://aws.amazon.com/releasenotes/
 - AWS Compute Blog: Amazon API Gateway - https://aws.amazon.com/blogs/compute/tag/amazon-api-gateway/
AWS
SUPPORT ENGINEER
Rajil_P
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions