ongov / API-Guidelines

Learn how to create services that can connect to and build on each other by using Application Programming Interfaces (APIs). Apprenez à créer des services qui peuvent se connecter les uns aux autres et se compléter en utilisant les interfaces de protocole d’application (API).
Other
25 stars 8 forks source link

Use problem+json #4

Open ioggstream opened 5 years ago

ioggstream commented 5 years ago

I suggest

Use problem+json rfc 7807, together with SOAP 1.2 faults to avoid inconsistencies in schema and implement a global error-management strategy.

https://github.com/ongov/API-Guidelines/blame/master/API-Guidelines.md#L195

AofH commented 5 years ago

RFC 7807 is a good example of how an API might respond to errors. However it may not be suitable for all API's being built. I will ask the team to link out to the RFC as an good example of error handling and messages.

ioggstream commented 5 years ago

Great! In Italy we're trying to standardize the error semantics for HTTP APIs to address cascade failures (Eg. when a service is made up of different interacting APIs).

It's important to note that - in that case - having a consistent way to transport some failure information without disclosing implementation details (Eg. http status code, ...) become critical for that kind of services to interoperate.