Contributor¶
Code¶
Have a look at the source files to see examples of how we structure things.
We use the following conventions based on [PEP8]:
- Code should always use UTF-8
- Code should always use Unix line endings(
\n) - Use 4 spaces per indentation level
- Avoid trailing whitespace anywhere
Documentation¶
Have a look at the source files to see examples of how we structure things.
We use the following conventions based on [RESTfulAPI.net] and [Tom2019]:
- Format the JSON
- The endpoint shows the end path only
- Do not use trailing forward slash (/) in URIs
- Represent path parameters with curly braces, see RFC 6570
- Use realistic values in examples
- Format request examples in curl
Three Bash scripts are available to help with examples:
docs/examples/run-all.shwill run all examples and update the outputdocs/examples/cric2localhost.shchange the domain in the examples fromcricdatabase.com.brtolocalhost:3000docs/examples/localhost2cric.shchange the domain in the examples fromlocalhost:3000tocricdatabase.com.br
| [PEP8] | Guido van Rossum, Barry Warsaw, Nick Coghlan. PEP 8 – Style Guide for Python Code. 2013. https://www.python.org/dev/peps/pep-0008/ |
| [Tom2019] | Tom Johnson. Learn API Doc. 2020. https://idratherbewriting.com/learnapidoc/. |
| [RESTfulAPI.net] | RESTfulAPI.net. REST Resource Naming Guide. REST API Tutorial. 2020. https://restfulapi.net/resource-naming/. |