Contributing to sttp-oauth2
This is an early stage project. The codebase is prone to change. All suggestions are welcome, please create an issue describing your problem before contributing.
Please make sure to format the code with scalafmt using .scalafmt.conf
from the repository root.
#
Working with documentationThe documentation is built using mdoc combined with docusaurus v2.
To build the documentation make sure you have installed Node.js and Yarn according to docusaurus requirements.
#
Working on documentation locally using live reloadFor live reload you'd preferably need two console windows open. In both you should navigate to your repository root, then:
In the first terminal, launch sbt
shell and run docs/mdoc --watch
.
In the second one run:
If it's your first time, remember to run npm install
in the ./website
directory
#
Documentation build workflowThe raw documentation goes through a few steps process before the final website is created.
- Raw data resides in
./docs
directory, it follows regular docusaurus rules regarding creating documentation - The first step when building the documentation is to run
docs/mdoc/
. This step compiles the code examples, verifying if everything makes sense and is up to date. - When the build finishes, the compiled documentation ends up in
./mdoc/target/mdoc/
- The last step is to build docusaurus. Docusaurus is configured to read files from
./mdoc/target/mdoc/
and generate the website using regular docusaurus rules.
#
Adding JSON implementationsWhen adding a JSON implementation please follow the subsequent guidelines:
- Each JSON implementation should exist in a separate module, not to introduce unwanted dependencies.
- It should expose all necessary
JsonDecoder
s via a single import following theimport org.polyvariant.sttp.oauth2.json.<insert-json-library-name-here>.instances._
convention. - It should make use of
org.polyvariant.sttp.oauth2.json.JsonSpec
test suite to ensure correctness. - It should be included in the documentation (JSON Deserialisation).