Skip to content
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

Can the documentation of functions in this library be improved? #970

Open
FaizanAhmedSP707 opened this issue Nov 22, 2024 · 1 comment
Open

Comments

@FaizanAhmedSP707
Copy link

For context, I've been using Fuel quite a bit for my projects ever since my university tutor introduced it to me last year and it has been very helpful in managing network operations so thank you for making this library and maintaining it.

On the flip side, I'm kind of disappointed in the lack of some documentation for the Fuel library's functions, such as the "httpGet" and the "responseJson" (an extension function of the Request class) as these are sometimes the most common functions that developers end up using. The problem with this is that if you have a syntax error and need to see what exactly the function needs and how it basically works, you don't get any useful information, apart from the lint tool of Android Studio giving this message which is a bit confusing:

Incompatible types: Result.Success<*> and Response

This error stems from Android Studio much stricter code checks in newer versions on Fuel code compared to older versions, while using the same version of Fuel: 2.3.1

The following code example shows errors in AS Ladybug compared to older versions from 2023:

val url = "{Insert some URL here}"
url.httpGet().responseJson { request, result, response ->
when(result) {
is Result.Success -> {
// Some code
}
is Result.Failure -> {
// Some code
}
}
}

In older versions, leaving is Result.Success and is Result.Failure as is would not highlight any errors, but now it actually does because everything actually needs to be specified. So in short, I'd just like to see a couple of sentences describing what a particular function does, what parameters it needs, what it outputs from the function, and what errors will it throw if some conditions are not met just like the standard Android libraries. I think that this addition would make the library a lot more user-friendly.

@kittinunf
Copy link
Owner

kittinunf commented Nov 29, 2024

@FaizanAhmedSP707 Thanks for commenting here. Honestly, I think you are right here. Truth to be told, I was burnt out quite a bit during last year + this year due to personal circumstances and yes, it affects my ability to code including to maintain the project to the level that Fuel deserved.

However, I plan to do this better during this year's downtime (December, Christmas, and New Year) to get this back up to the level that it should be maintained. If you have any feedback, please let me know.

Thanks again for being a guy who points out what the missing piece is. I will get this back on track.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants