Swiftpack.co - jemmons/SessionArtist as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by jemmons.
jemmons/SessionArtist v6.0.0
Adds structure around URLSession for beautiful APIs.
⭐️ 0
🕓 1 week ago
.package(url: "https://github.com/jemmons/SessionArtist.git", from: "v6.0.0")

SessionArtist

Adds structure around URLSession for beautiful APIs.

GitHub

link
Stars: 0
Last commit: 1 week ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Dependencies

Release Notes

Moves Host to reference type. Removes Medea dependency.
3 years ago

Moves Host to Reference Type

The Host type holds a reference to a URLSession instance responsible for all requests. So any representation that it was a value type was half-hearted at best and misleading at worst.

Removes dependency on Medea package

Medea was primarily being used for its AnyJSON type’s ability to handle all JSON fragments. But fragments at the top level of responses are unsupported by specs like JSON:API and have never been a good idea. JSON object types are easy to provide without Medea’s help via JSONSerlialization. And really, even this minimal amount of JSON parsing is less common now that Codable is a thing and decoding is happening at the call site. Everyone just wants Data.

Of the rest of it’s features, the ValidJSONObject type is the only that was really being used, and that's trivial to implement internally to SessionArtist.

Breaking Changes

  • Host is now a class instead of a struct.
  • Request.json(_:) has been removed.
  • Medea types like JSONObject, JSONArray, and ValidJSONObject are now directly under the SessionArtist namespace.
  • Actions that threw Medea-originated errors still throw errors. But now they're of the SessionArtist.Error type.
  • Package.swift has been updated to version 5.2. This should mean dependencies only used for testing (like Perfidy) will no longer be pulled by consumers.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics