PokeAPI / pokekotlin

Kotlin (or Java, Scala, etc) client for PokeApi
Apache License 2.0
171 stars 43 forks source link

Call by name #34

Closed sargunv closed 4 years ago

sargunv commented 8 years ago

Named resources should be retrievable by name too, not just by id.

sargunv commented 8 years ago

On hold as per discussion in https://github.com/PokeAPI/pokeapi/issues/216

phalt commented 8 years ago

@sargunster this functionality won't be removed, even if we choose to no longer support it, so it's okay to include it in the wrapper.

sargunv commented 8 years ago

I'm just unsure of whether it should be added or not, since encouraging use of IDs seems better. Maybe it could be added but marked with @Deprecated.

Regardless, I would work on it later since I'm going to spend a few days making progress on other things :P

Also, it would require me to include all the named JSON in the test resources, which would bulk up the repo a bit. I have plans so that'll no longer be a problem, but that'll require a Kobalt update.

cr0wst commented 7 years ago

I know this is a bit old but I just started using this library for an IRC Bot.

@sargunster Did you ever consider adding a static class for looking up ID by name using a local resource? I ended up just using an array of Strings and finding their position on that. It really didn't take me that long to create, but perhaps it could be something added here?

Edit: Unfortunately my knowledge of Kotlin is non-existent. I'm more proficient in Java and Groovy.

sargunv commented 7 years ago

I was looking to just match the API call-for-call, so didn't do much extra. If you want to add something like that, I'm open to a PR.

Sorry for the late response.

sargunv commented 4 years ago

get by name won't be supported.