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
demandé il y a un an292 vues
1 réponse
3
Réponse acceptée

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
INGÉNIEUR EN ASSISTANCE TECHNIQUE
Rajil_P
répondu il y a un an

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions