I'm attempting to implement an API defined in Swagger or OpenAPI 3.0 using AWS API Gateway.
One endpoint in this API takes an abstract base model (lets call it Pet to be consistent with the well-worn Swagger example), but actually expects a concrete model that is derived from Pet... Dog for example.
The concrete model can be determined by a type attribute on Pet.
The concrete model can add additional fields.
Of course, this a job for a discriminator:
definitions:
    Pet:
        discriminator: petType
        required:
        - name
        - petType # required for inheritance to work
        properties:
        name: 
            type: string
        petType:
            type: string
    Cat:
        allOf:
        - $ref: '#/definitions/Pet' # Cat has all properties of a Pet
        - properties: # extra properties only for cats
            huntingSkill:
                type: string
                default: lazy
                enum:
                - lazy
                - aggressive
    Dog:
        allOf:
        - $ref: '#/definitions/Pet' # Dog has all properties of a Pet
        - properties: # extra properties only for dogs
            packSize:
                description: The size of the pack the dog is from
                type: integer
(taken from here)
However, AWS API Gateway doesn't support discriminator (ref).
OK, annoying, but maybe a workaround is to define the API with OpenAPI 3.0, and utilise oneOf in the schema:
paths:
    /pets:
        patch:
            requestBody:
                content:
                    application/json:
                        schema:
                            oneOf:
                                - $ref: '#/components/schemas/Cat'
                                - $ref: '#/components/schemas/Dog'
However (again), AWS API Gateway doesn't support oneOf either (ref).
Does anyone know how to implement a model schema of this nature with AWS API Gateway, in particular to take advantage of body validation for an inheritance pattern (Pet <- Dog)? Or indeed a workaround without having to have methods for every concrete type?