yaml file syntax-None and "None"
Test Xiaobai, when using pycharm to adjust the interface, the problems encountered when writing scripts:
premise: yaml file
The first way to pass parameters-None:
yaml file:
adjust the interface, check the sent request parameters: The parameter in the
yaml file is not given a value, and the interface is adjusted, and it is found that None is sent in the request, which is equivalent to no value and no memory space is allocated.
The second way to pass parameters-"None":
Yaml file:
adjust the interface, check the sent request parameters: The
value of None is directly given in the yaml file, adjust the interface, and find that the string "None" is sent in the request.
in conclusion
- The above two parameter transfer methods are different in the yaml file.
- Secondly, if the passed parameter exists, the passed parameter is actually a string field (the second parameter passing method mentioned above).
- If you want to pass a null value, you don't need to give a parameter, just write the key, and don't fill in the corresponding value (the first way of passing parameters above).
Extended learning:
The null value in the yaml file can also be represented by null or ~, that is, the following three parameter passing effects are the same: