Skip to content

Improve error message when schema doesn't match #8

@sidvishnoi

Description

@sidvishnoi

As an example, when creating a grant request, the access_token can have 3 options: access-incoming, access-outgoing and access-quote.

Use type: "outgoing-payment" there, but forget to provide the identifier field. Now schema won't match access-outgoing anymore.

Expected error: field identifier is required with type: "outgoing-payment"
Received error: body.access_token.access.0.type must be equal to one of the allowed values

So, missing identifier switched schema to be access-quote (as it's only option without this field), but then it expected type to be "quote", hence the incorrect error message.

Same problem can extend to other request bodies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions