-
Notifications
You must be signed in to change notification settings - Fork 21
docs: note on exposed dependencies #428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✗ The generated branch has been deleted.If the PR has been merged, you can check the generated code on the |
✅ Deploy Preview for api-clients-automation ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Glad to see the netlify bot commenting twice like ours did :D No need to fix it |
website/docs/addNewLanguage.md
Outdated
@@ -88,6 +88,15 @@ Then the resulting User Agent is `Algolia for Java (5.0.0); Search (5.0.0); JVM | |||
|
|||
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason behind this could be added
website/docs/addNewLanguage.md
Outdated
- a function cannot accept an object from a dependency as a parameter | ||
- and so on | ||
|
||
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have an example we can link?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a good example right now, I need to make that change in the java client
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then I think it's good to come back here after the change. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will add the example once I do the change on java yes, but the doc can still exists in the mean time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not forget to add the example later on. It looks good to me!
🧭 What and Why
State that we should not expose dependencies in our client (this is not yet the case for Java)