You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
APIs are usually hierarchically structured, for ease of use. This is poorly supported in Krosstalk, you would have to explicitly add the endpoint prefix for every method in an KrosstalkEndpoint annotation.
Idea: Annotation for classes, objects, and files(?) (and eventually namespaces) that adds a prefix to Krosstalk endpoints within them. After the krosstalk prefix? Would need to restructure KrosstalkEndpoint to not include the prefix. The class one needs to apply to the companion object as well.
This gives something like:
@KrosstalkPrefix("item")
@Serializable
data class Item(val id: String){
@KrosstalkMethod
@KrosstalkEndpoint("description", GET)
suspend fun getDescription(): String
companion object {
@KrosstalkMethod
@KrosstalkEndpoint(method=POST)
suspend fun create(id: String, description: String): Item
}
}
I'd like a way to make the description point /item/$id/description, perhaps @KrosstalkPrefix on classes could include serialization mapping, and maybe for fields if they are all constructor params?
The text was updated successfully, but these errors were encountered:
APIs are usually hierarchically structured, for ease of use. This is poorly supported in Krosstalk, you would have to explicitly add the endpoint prefix for every method in an
KrosstalkEndpoint
annotation.Idea: Annotation for classes, objects, and files(?) (and eventually namespaces) that adds a prefix to Krosstalk endpoints within them. After the krosstalk prefix? Would need to restructure KrosstalkEndpoint to not include the prefix. The class one needs to apply to the companion object as well.
This gives something like:
I'd like a way to make the description point
/item/$id/description
, perhaps@KrosstalkPrefix
on classes could include serialization mapping, and maybe for fields if they are all constructor params?The text was updated successfully, but these errors were encountered: