Skip to content

Please expose "source" attribute for ErrorItem #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
softak098 opened this issue Mar 24, 2025 · 3 comments · Fixed by #40
Closed

Please expose "source" attribute for ErrorItem #37

softak098 opened this issue Mar 24, 2025 · 3 comments · Fixed by #40
Assignees

Comments

@softak098
Copy link

The JsonApi.ErrorItem only exposes "Code" and "Detail".
Please expose also "Source" to see where error occurred.

Thanks

@stephdewit stephdewit self-assigned this Mar 26, 2025
@stephdewit
Copy link
Collaborator

Hello @softak098

I'm a little bit confused by this Source field, it's not something I know.

Could you provide a link to the specific part of the documentation or a screenshot of this attribute?

Thanks!

@softak098
Copy link
Author

Hello,
the Ibanity documentation indeed does not mention that, but actually the service uses it to describe
the error in deep details.

This is part of error response from create supplier api:

{"errors":[ {"code":"validationError","detail":"must not be blank","source":{"pointer":"/data/attributes/representativeIdScan"}}] }

or

{"errors":[{"code":"validationError","detail":"must be a valid international phone number","source":{"pointer":"/data/attributes/phoneNumber"}},{"code":"validationError","detail":"must be a valid Belgian enterprise number","source":{"pointer":"/data/attributes/enterpriseIdentification/enterpriseNumber"}},{"code":"validationError","detail":"must not be blank","source":{"pointer":"/data/attributes/representativeIdScan"}},{"code":"validationError","detail":"the VAT number must correspond to the enterprise number","source":{"pointer":"/data/attributes/enterpriseIdentification"}},{"code":"validationError","detail":"must be a valid URL","source":{"pointer":"/data/attributes/homepage"}}]}

Pavel

@stephdewit
Copy link
Collaborator

Hello @softak098

A new 0.6.6 release has been published. It makes this field available in the exception.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants