Skip to content

Commit

Permalink
docs: note on exposed dependencies (#428)
Browse files Browse the repository at this point in the history
  • Loading branch information
millotp authored Apr 26, 2022
1 parent 90e713d commit 1380029
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions website/docs/automation/add-new-language.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,18 @@ Algolia for Java (5.0.0); Search (5.0.0); JVM (11.0.14); experimental

You can take a look at the Java implementation [here](https://github.com/algolia/api-clients-automation/pull/347).

### Dependencies

You can use any dependency you want to create the client, it can be Json parser or HTTP client, but it's important to never expose those dependencies through the client, meaning:
- a function cannot return an object from a dependency
- a function cannot accept an object from a dependency as a parameter
- and so on

It matters because when a dependency is exposed, a breaking change from our deps can affect the user code while the API client is still working correctly (because they have to use the dependency in their code),
and that prevent us from upgrading our deps. In some languages it also requires the user to add our internal dependencies to his build system, which is very inconvenient and our clients should always be standalone.

To achieve this you can create interfaces that can be exposed, and wrap the method you want to be exposed, for an HTTP client for example.

### Requesters

> TODO: informations
Expand Down

0 comments on commit 1380029

Please sign in to comment.