In this week, I read some articles about restful, and then according to the 
requirements, I made the specification document (Draft) suitable for our 
project, and gave the Chinese and English versions in the link. 
Englih-version、Chinese-version
    Now I have two problems, one is about API version management, the other is 
about the use of PATCH Method.
1. Version controller
    Does our project have such a requirement scenario: we need to modify the 
return data to change the interface logic, but at the same time, we need to 
ensure the compatibility with the old version, as shown in the figure below. If 
so, we need to introduce version number management. At the same time, we also 
need to communicate a set of specific solutions and implementation details See 
the link for details: https://segmentfault.com/a/1190000006165182
2. PATCH method
    PATCH is similar to PUT. PATCH is used to update part of the content of a 
resource. For example, only the phone number field of user information is 
updated. In addition, PATCH also means to create or save.
    Put is used to update the complete content of a resource. For example, a 
user needs to fill in a complete form to update all information. 
     In our project, I learned that our parameter passing is usually local. 
Therefore, should we change the request mode type from PUT to PATCH. This may 
cause some people's antipathy.


     Next, I will continue to follow up the design of restful documents, and 
initially improve all interfaces of the project.

Reply via email to