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?

1개 답변
3
수락된 답변

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
지원 엔지니어
Rajil_P
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인