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
回答済み 1年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ