New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bridge KituraNet.HTTPStatusCode #1217
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1217 +/- ##
=======================================
Coverage 89.39% 89.39%
=======================================
Files 38 38
Lines 2234 2234
=======================================
Hits 1997 1997
Misses 237 237
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good. Couple of questions:
- how does the API documentation look: if someone were to browse the API doc for
Kitura.HTTPStatusCode
, do they automatically get a reference / link toKituraNet.HTTPStatusCode
? - does XCode completion 'follow' the typealias and give you the possible values?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look much more intuitive for users.
Like Dave, I think it would be good if we could make the API reference redirect users to the HTTPStatusCode documentation in Kitura-net, but I don't know how feasible this is in jazzy.
I tried generating Jazzy for this, but I didn't get any entry for the |
09a2b58
to
0b80716
Compare
Fixed the doc generation problem (needed to add a private dummy class to keep Jazzy happy). I have added links to KituraNet.HTTPStatusCode as well. |
Just waiting until we have the automatic doc generation code wired up before merging this (Kitura/Package-Builder#128) |
001cfdb
to
3c2d59e
Compare
CI for ade5187 will fail until Kitura/Package-Builder#133 is merged. |
Github does not seem to receive the Travis CI status for a PR when the most recent commit is labelled |
Description
Add a
typealias
ofHTTPStatusCode
into Kitura so that a user can use the type without also having to import KituraNet.Motivation and Context
While developing with Kitura, @CosmicYogi ran into unresolved symbol errors with
HTTPStatusCode
. Thus led to a discussion on Slack and this PR: #1208.The issue is that you need to
import KituraNet
if your code usesHTTPStatusCode
directly.The solution proposed by @CosmicYogi was to document the requirement in the related Kitura API documentation. This is a reasonable approach given most people will probably look at the API doc for a function if they see a compile error.
What I think would be even better, is to prevent this issue entirely so that
HTTPStatusCode
can be used even if only Kitura were imported.How Has This Been Tested?
Tested on macOS (in SPM and Xcode builds) and Linux, using a simple project that uses
HTTPStatusCode
and has separate test files that:Checklist: