Skip to content

Required Field type Issue #172

Description

@lmregus

Hello, I am building an integration with an external webhook, unfortunately the webhook returns 2 slightly different payloads depending if the payload has a collection of objects or not.

I am trying to use the OneOfSchema to allow my endpoint to support these 2 different schemas, but when I hit the endpoint it fails saying that it requires the type field, when I add the type field with the expected value it works fine, the problem with this is that I have no access to the real payload being created which means that I can not ask the third party service to add the type key with the expected value to the payload before sending it.

In code I have something like this:

@bp.route(
    f"/{RESOURCE}/endpoint"
)
class className(MethodView):
    @bp.arguments(OneOfSchemaClass)
    @bp.response(200)
    def post(self, data: dict):

Is this something that's not supported/achievable? Unless the type key is explicitly set in the incoming payload?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions