auth0 / Auth0.Android

Android toolkit for Auth0 API
https://auth0.com
MIT License
216 stars 133 forks source link

Incorrect example documentation #703

Open aaronatbissell opened 10 months ago

aaronatbissell commented 10 months ago

Checklist

Description

The example documentation for setting request headers is incorrect. The example code shows incorrect Java syntax.

Map<String, String> defaultHeaders = new HashMap<>();
defaultHeaders.put("{HEADER-NAME}", "{HEADER-VALUE}");

DefaultClient netClient = new DefaultClient(
    defaultHeaders = defaultHeaders
);
Auth0 account = new Auth0("client id", "domain");
account.networkingClient = netClient;

should probably be

Map<String, String> defaultHeaders = new HashMap<>();
defaultHeaders.put("{HEADER-NAME}", "{HEADER-VALUE}");
DefaultClient netClient = new DefaultClient(10, 10, defaultHeaders, false); // <-- This needs to take all the parameters unless we use the @JvmOverloads tag
Auth0 account = new Auth0("client id", "domain");
account.setNetworkingClient(netClient); // <-- need to use the getter/setter generation here unless we use the @JvmField tag in the source code

I'm assuming this probably isn't the only case where this is incorrect.

Reproduction

Look at the example documentation

Additional context

No response

Auth0.Android version

N/A

Android version(s)

N/A