1
0
mirror of https://github.com/twirl/The-API-Book.git synced 2025-03-03 15:22:13 +02:00

style fix

This commit is contained in:
Sergey Konstantinov 2021-04-25 15:45:40 +03:00
parent ca673ec3f2
commit ffd1fbe147
2 changed files with 3 additions and 3 deletions

View File

@ -335,7 +335,7 @@ POST /users
**NB**: the contradiction with the previous rule lies in the necessity of introducing ‘negative’ flags (the ‘no limit’ flag), which we had to rename to `abolish_spending_limit`. Though it's a decent name for a negative flag, its semantics is still unobvious, and developers will have to read the docs. That's the way.
##### Avoid partial updates
##### Avoid implicit partial updates
**Bad**:
```
@ -372,7 +372,7 @@ Transferring only a subset of fields solves none of these problems, in the best
* introducing pagination and field value length limits;
* stopping saving bytes in all other cases.
**In second**, shortening response sizes will backfire exactly with sploiling collaborative editing: one client won't see the changes the other client has made. Generally speaking, in 9 cases out of 10 it is better to return a full entity state from any modifying operation, sharing the format with read access endpoint. Actually, you should always do this unless response size affects performance.
**In second**, shortening response sizes will backfire exactly with spoiling collaborative editing: one client won't see the changes the other client has made. Generally speaking, in 9 cases out of 10 it is better to return a full entity state from any modifying operation, sharing the format with read access endpoint. Actually, you should always do this unless response size affects performance.
**In third**, this approach might work if you need to rewrite a field's value. But how to unset the field, return its value to the default state? For example, how to *remove* `client_phone_number_ext`?

View File

@ -331,7 +331,7 @@ POST /users
**NB**: противоречие с предыдущим советом состоит в том, что мы специально ввели отрицающий флаг («нет лимита»), который по правилу двойных отрицаний пришлось переименовать в `abolish_spending_limit`. Хотя это и хорошее название для отрицательного флага, семантика его довольно неочевидна, разработчикам придётся как минимум покопаться в документации. Таков путь.
##### Избегайте частичных обновлений
##### Избегайте неявных частичных обновлений
**Плохо**:
```