This repository has been archived by the owner on Sep 30, 2024. It is now read-only.
Releases: FlineDev/Microya
Releases · FlineDev/Microya
0.7.0
0.6.1
0.6.0
0.5.0
Added
- New
mockingBehavior
parameter onApiProvider
for testing purposes. Specify one withdelay
andscheduler
, e.g..seconds(0.5)
andDispatchQueue.main.eraseToAnyScheduler()
. Providesnil
by default to make actual requests. - New optional
mockedResponse
computed property onEndpoint
protocol expecting an output of typeMockedResponse
. Use this to provide mocked responses when using amockingBehavior
in tests. See the PostmanEchoEndpoint in the tests for a usage example via themock
convenience method.
Changed
- Moved
baseUrl
fromEndpoint
toApiProvider
. This allows for specifying differentbaseUrl
even whenEndpoint
is implemented in a library by passing it in the app. - Renamed
HttpBasicAuthPlugin
toHttpAuthPlugin
with a newscheme
parameter that accepts one of.basic
or.bearer
to support multiple authentication methods.
0.4.0
Added
- Microya now supports Combine publishers, just call
publisher(on:decodeBodyTo:)
orpublisher(on:)
instead ofperformRequest(on:decodeBodyTo:)
orperformRequest(on:)
and you'll get anAnyPublisher
request stream to subscribe to. In success cases you will receive the decoded typed object, in error cases anApiError
object exactly like within theperformRequest
completion closure. But instead of aResult
type you can usesink
orcatch
from the Combine framework.
Changed
- The
queryParameters
is no longer of type[String: String]
, but[String: QueryParameterValue]
now. Existing code like["search": searchTerm]
will need to be updated to["search": .string(searchTerm)]
. Apart from.string
this now also allows specifying an array of strings like so:["tags": .array(userSelectedTags)]
. String & array literals are supported directly, e.g.["sort": "createdAt"]
or["sort": ["createdAt", "id"]]
.
0.3.0
Added
- New
ApiProvider
type encapsulating different request methods with support for plugins. - New asynchronous
performRequest
methods with completion callbacks. (#2) - New
Plugin
class to subclass for integrating into the networking logic via callbacks. - New pre-implemented plugins:
HttpBasicAuth
,ProgressIndicator
,RequestLogger
,ResponseLogger
. - New
EmptyResponseBody
type to use whenever the body is expected to be empty or should be ignored.
Changed
- Renamed
JsonApi
protocol toEndpoint
. - Renamed
Method
toHttpMethod
and addedbody: Data
to the casespost
andpatch
. - Moved the
request
method fromJsonApi
to the newApiProvider
& renamed toperformRequestAndWait
. - Generally improved the cases in
JsonApiError
& renamed the type toApiError
. - Moved CI from Bitrise to GitHub Actions.