Multiplatform Ktor schema declaration • opensavvy.spine.api • div
div¶
operator fun <R : Resource, Endpoint : AnyEndpoint> ResolvedResource<R>.div(endpoint: Endpoint): ResolvedEndpoint<Endpoint>
operator fun <Current : Resource, Child : StaticResource<Current>> ResolvedResource<Current>.div(child: Child): ResolvedResource<Child>
Resolves the static child resource under this ResolvedResource.
This operator participates in the resource resolution DSL.
Example¶
operator fun <Current : Resource, Child : DynamicResource<Current>> ResolvedResource<Current>.div(child: DynamicResource.Identified<Current, Child>): ResolvedResource<Child>
Resolves the dynamic child resource under this ResolvedResource by binding its identifier.
The identifier and the target resource are carried by DynamicResource.Identified, typically created via the DynamicResource.invoke operator, e.g. User("123").
This operator participates in the resource resolution DSL.
Example¶
operator fun <Root : RootResource, Child : StaticResource<Root>> Root.div(child: Child): ResolvedResource<Child>
Starts resolution from the RootResource and resolves the static child.
Syntactic sugar for this.resolved / child.
operator fun <Root : RootResource, Child : DynamicResource<Root>> Root.div(child: DynamicResource.Identified<Root, Child>): ResolvedResource<Child>
Starts resolution from the RootResource and resolves the dynamic child.
Syntactic sugar for this.resolved / child.