The current code passes accessToken everywhere so each Controller creates its own SchedJoulesApi instance. That's not a good design. Instead the SchedJoulesApi object should created at the top level (by the user of the SDK) and passed to each instance which needs to send requests to the API. So instead if a String with the accessToken, all controllers should accept an Api instance.
The current code passes accessToken everywhere so each Controller creates its own
SchedJoulesApi
instance. That's not a good design. Instead theSchedJoulesApi
object should created at the top level (by the user of the SDK) and passed to each instance which needs to send requests to the API. So instead if a String with the accessToken, all controllers should accept anApi
instance.