plaid-openapi icon indicating copy to clipboard operation
plaid-openapi copied to clipboard

Introduce accurate error schema for object-embedded error responses

Open ali-sharif opened this issue 4 years ago • 1 comments

For response objects where the Error is an embedded object (e.g. Item, Wbehook responses, etc.), the schema as defined is not accurate, since it marks the field request_id as required (which will not be supplied).

This has the following side-effect: if anyone is using this open-api spec to perform response validation on the Plaid API, the validation on those objects which embed Errors will fail due to absence of the request_id field.

The the solution proposed in this PR is to introduce an ErrorBase schema which contains all the field definitions for the current Error schema EXCEPT for the request_id field. Then the Error schema is defined as the union of the ErrorBase and an object carrying only the request_id field (marked as required).

ali-sharif avatar May 04 '21 19:05 ali-sharif

Thank you for this @ali-sharif. We will backport this change locally and create an update.

cgfarmer4 avatar May 14 '21 22:05 cgfarmer4