-
Notifications
You must be signed in to change notification settings - Fork 13
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
FgaRequiredParamError: Required parameter apiHost was null or undefined when calling Configuration. #154
Comments
Hi, could you please assign this issue to me? I'd like to work on it. Thanks! |
if i am not mistaken, To modify the OpenFgaClient constructor to handle the situation where the apiURL parameter is not supplied, you'll need to ensure that the validation for the apiURL is correctly integrated. Add a Validation Check for apiURL: Ensure that if the apiURL is not provided, an appropriate error message is thrown, indicating that the apiURL is required, rather than referring to the deprecated apiHost. Error Handling: The assertParamExists function checks if the apiUrl parameter is null or undefined and throws an error with the correct message indicating that the apiUrl parameter is required. This aligns with your expectation that the error message should direct the user to provide the apiUrl instead of the deprecated apiHost. |
Can I go ahead and open a pull request for this change |
👋🏻 Thanks for picking this up @Waheedsys! I think we'd want to perform this check in the This is happening because of the existing check. It's slightly awkward as we want to ensure we maintain compatibility for existing users who were setting |
Hi @ewanharris, If I’m not mistaken, here are some points to keep in mind while addressing the issue: Maintain Compatibility: We should ensure that we don't disrupt functionality for users still relying on apiScheme and apiHost. Adjust the Check: Instead of solely checking for the absence of apiUrl, let's also verify whether both apiScheme and apiHost are missing. If they are, we can then require apiUrl. Clear Error Messages: If apiUrl is absent and both apiScheme and apiHost are not provided, we should throw a clear error indicating that apiUrl is required. This will help users understand what’s missing. Validate apiUrl: When apiUrl is provided, we need to ensure it’s well-formed. If it’s not, we should throw an error to guide users. Check URI Validity: If neither apiUrl nor valid apiScheme and apiHost combinations are supplied, we should throw an appropriate error message. |
@Waheedsys absolutely, those all sound correct to me! |
@ewanharris who's Mailing Address is required for the Individual Contributor License Agreement |
@Waheedsys I believe when signing the individual CLA all details should be your own. |
Thank you for the clarification @ewanharris. Unfortunately, I received an email from support stating that this issue has been resolved as "won't do. |
@Waheedsys unfortunately I don't have access to the LFX support system. Are you facing issues signing the CLA after clicking the link in this comment? |
@ewanharris i have signed the CLA |
Checklist
Description
When
apiURL
parameter is not supplied while initializing the OpenFGA client, we get an error message that suggests using deprecatedapiHost
parameter:FgaRequiredParamError: Required parameter apiHost was null or undefined when calling Configuration.
Expectation
The error message should be to supply an appropriate
apiUrl
parameter, NOT the deprecatedapiHost
parameter.Reproduction
OpenFGA SDK version
0.6.3
OpenFGA version
latest
SDK Configuration
javascript
Logs
No response
References
No response
The text was updated successfully, but these errors were encountered: