This PR re-designs the OAuth service endpoint API, or how the endpoints for a given service should be accessed.
Instead of a general OAuthService type, there is an OAuthServiceProtocol protocol that defines how an OAuth service type should be defined. These custom types use the @Endpoint property wrapper to define properties that represent endpoints for an API.
The Request.create and Request.fetch methods have been replaced with Request.get, along with .uncache methods.
Finally, each service implementation can implement an extension on Request that allows you to easily access defined endpoints that that service.
Currently, each service still needs its full catalog of endpoints defined. An additional bonus would also be defining the Codable types that represent the response data that we get back from those endpoints.
This PR re-designs the OAuth service endpoint API, or how the endpoints for a given service should be accessed.
Instead of a general
OAuthService
type, there is anOAuthServiceProtocol
protocol that defines how an OAuth service type should be defined. These custom types use the@Endpoint
property wrapper to define properties that represent endpoints for an API.The
Request.create
andRequest.fetch
methods have been replaced withRequest.get
, along with.uncache
methods.Finally, each service implementation can implement an extension on
Request
that allows you to easily access defined endpoints that that service.Currently, each service still needs its full catalog of endpoints defined. An additional bonus would also be defining the
Codable
types that represent the response data that we get back from those endpoints.