en:outskirts:mages-peaks:api
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:outskirts:mages-peaks:api [2024/07/14 14:55] – [GET /character/{character_id}] YannZeRookie | en:outskirts:mages-peaks:api [2024/10/28 08:00] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 4: | Line 4: | ||
| Also check out the [[en: | Also check out the [[en: | ||
| + | |||
| + | ==== General Philosophy of the API ==== | ||
| + | |||
| + | When dealing with any API, there are usually two types of philosophies: | ||
| + | |||
| + | In a **strict API**, the server (and the client) throws an error when it does not get exactly the schema it was expecting. So extra or missing fields would trigger an error. The reasoning is that it is a smell and we don’t want to risk corrupting any data. This introduces strong coupling, and therefore the need to define so-called "api versions" | ||
| + | |||
| + | In a **permissive API**, the server (and again, the client), won’t throw an error most of the time. If a field was missing, a default value is used. And any extra field will simply be ignored. This introduces loose coupling. | ||
| + | |||
| + | Both approaches have advantages and disadvantages. The strict approach is usually preferred in corporate contexts with strong IT and/or business stakes. The permissive approach is more suited to flexible and fast development, | ||
| + | |||
| + | Another example: in a strict API, a non-relevant field will still be provided but with a '' | ||
| + | |||
| + | **For the sake of simplicity and flexibility, | ||
| + | |||
| ==== GET /hello ==== | ==== GET /hello ==== | ||
en/outskirts/mages-peaks/api.1720968903.txt.gz · Last modified: 2024/10/28 08:00 (external edit) · Currently locked by: ::1,216.73.216.252
