writefreely / writefreely-swift

A Swift package wrapping the WriteFreely / Write.as API
BSD 3-Clause "New" or "Revised" License
9 stars 1 forks source link

Refactor WriteFreelyClient to use RequestTemplates #7

Closed AngeloStavrow closed 3 years ago

AngeloStavrow commented 4 years ago

Currently, WriteFreelyClient is not especially DRY — because so much of the request code is repeatable, it would make more sense to pull that out into a RequestTemplate of sorts.

This should also help with the type_body_length linting issue for the WriteFreelyClient class being too long:

Type body should span 200 lines or less excluding comments and whitespace: currently spans 519 lines

(This exceeds SwiftLint's warning level, and would instead be a build-blocking error once #6 is implemented, so this should be labeled a bug rather than an enhancement.)

Useful reference: "Keeping Your Network Layer Clean With DRY" by Frank Courville

AngeloStavrow commented 3 years ago

Closed by #27.