ChildPath

public struct ChildPath<R: NestedResource, Path, Method>

This struct encodes the partial path to an operation on a remote resource or a collection. It has the same semantics as Path — encoding method etc. — but cannot be used to make a request. Instead it has to be appended to a Path.

Imagine we have a hierarchy like this: /groups/{group_id}/users/{user_id}. We don’t want to allow a path like /users/1 to be used to make a request. So we encode it as a ChildPath. We would turn it into a qualified path using the /(_:_:) operator.

Note: In general usage, you should not need to construct an instance of this type. Instead they are generated by functions defined on Resource.

  • The path to the resource collection e.g. users, posts.

    Declaration

    Swift

    public let path: String