# SwiftNIO \`\_ChannelInboundHandler\` is DocC incompatible

**URL:** <https://forums.swift.org/t/swiftnio-channelinboundhandler-is-docc-incompatible/58611>\
**Category:** Development\
**Created:** [July 1, 2022, 6:32pm UTC](https://forums.swift.org/t/swiftnio-channelinboundhandler-is-docc-incompatible/58611 "2022-07-01T18:32:35Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![taylorswift](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/taylorswift/32/43413_2.png) [@taylorswift](https://forums.swift.org/u/taylorswift)\
**Post date:** [July 1, 2022, 6:32pm UTC](https://forums.swift.org/t/swiftnio-channelinboundhandler-is-docc-incompatible/58611/1 "2022-07-01T18:32:35Z")

</div>

something i noticed while browsing through SwiftNIO docs as rendered by `swift-biome`: the library [references](https://swiftinit.org/reference/swift-nio/niocore/channelinboundhandler) documentation for underscored symbols like `_ChannelInboundHandler`, `_EmittingChannelHandler`, etc., but these symbols are invisible to [`swift-biome`](https://github.com/kelvin13/swift-biome) and other [SymbolGraphGen](https://github.com/apple/swift/tree/main/lib/SymbolGraphGen)-based tools, including DocC.

this means that Jazzy (the [SourceKit-based](https://github.com/realm/jazzy) backend version) is the only documentation compiler that currently works for SwiftNIO.

i’m not sure how complicated it would be to move the library off of these underscored APIs. but having passages like:

> Please refer to `_ChannelInboundHandler` and `_EmittingChannelHandler` for more details on the provided methods.

when these pages do not actually exist does not seem great…

---

<div class="post-metadata">

**Author:** ![Mordil](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/mordil/32/5840_2.png) [@Mordil](https://forums.swift.org/u/Mordil)\
**Post date:** [July 1, 2022, 7:23pm UTC](https://forums.swift.org/t/swiftnio-channelinboundhandler-is-docc-incompatible/58611/2 "2022-07-01T19:23:35Z")

</div>

How much of this is a SwiftNIO issue rather than DocC/SymbolGraph?

Those types are publicly defined, but they're not exported because of the special nature of `_` in symbol names.

---

<div class="post-metadata">

**Author:** ![taylorswift](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/taylorswift/32/43413_2.png) [@taylorswift](https://forums.swift.org/u/taylorswift)\
**Post date:** [July 1, 2022, 7:33pm UTC](https://forums.swift.org/t/swiftnio-channelinboundhandler-is-docc-incompatible/58611/3 "2022-07-01T19:33:53Z")

</div>

> [@Mordil](#):
>
> How much of this is a SwiftNIO issue rather than DocC/SymbolGraph?

this is a matter of opinion. personally i think SymbolGraphGen would be better off emitting all the symbols by default (regardless of implicitly private access), but others feel strongly that underscored APIs are not public APIs and therefore should not be picked up by documentation compilers.

this is not a DocC issue, as DocC is a consumer of SymbolGraphGen, just like `swift-biome` is.

related discussion: [(SymbolGraphGen) can we make `isImplicitlyPrivate` checking configurable?](https://forums.swift.org/t/symbolgraphgen-can-we-make-isimplicitlyprivate-checking-configurable/55781)

cc @franklin

---

<div class="post-metadata">

**Author:** ![lukasa](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/lukasa/32/1232_2.png) [@lukasa](https://forums.swift.org/u/lukasa)\
**Post date:** [July 3, 2022, 8:32am UTC](https://forums.swift.org/t/swiftnio-channelinboundhandler-is-docc-incompatible/58611/4 "2022-07-03T08:32:46Z")

</div>

> [@taylorswift](#):
>
> i’m not sure how complicated it would be to move the library off of these underscored APIs.

This is untenable. The better option is to move the _documentation_ off those APIs. Can you file a Github issue to track that please?

---

<div class="post-metadata">

**Author:** ![taylorswift](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/taylorswift/32/43413_2.png) [@taylorswift](https://forums.swift.org/u/taylorswift)\
**Post date:** [July 3, 2022, 5:49pm UTC](https://forums.swift.org/t/swiftnio-channelinboundhandler-is-docc-incompatible/58611/5 "2022-07-03T17:49:36Z")

</div>

how would you move the documentation off those APIs? the requirements themselves are being stripped from the symbol graph, so there would be no symbols to attach said documentation to…

---

<div class="post-metadata">

**Author:** ![lukasa](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/lukasa/32/1232_2.png) [@lukasa](https://forums.swift.org/u/lukasa)\
**Post date:** [July 4, 2022, 6:50am UTC](https://forums.swift.org/t/swiftnio-channelinboundhandler-is-docc-incompatible/58611/6 "2022-07-04T06:50:21Z")

</div>

Oh interesting, I hadn't realised that the doc did not render the protocol requirements in the case where it has erased the upstream protocol. That seems less than ideal: I think that we do need to find a way to cut through the limitations of SymbolGraphGen here.

---

<div class="post-metadata">

**Author:** ![franklin](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/franklin/32/17924_2.png) [@franklin](https://forums.swift.org/u/franklin)\
**Post date:** [July 4, 2022, 9:52am UTC](https://forums.swift.org/t/swiftnio-channelinboundhandler-is-docc-incompatible/58611/7 "2022-07-04T09:52:51Z")

</div>

I don't think emitting underscored symbols in symbol graph files makes sense by default, but emitting the (non-underscored) synthesised symbols that originate from underscored protocols makes sense to me (like the SwiftNIO case discussed above). I'd be interested in seeing how many additional symbols we produce for the standard library and do an audit of the results.

---

<div class="post-metadata">

**Author:** ![taylorswift](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/taylorswift/32/43413_2.png) [@taylorswift](https://forums.swift.org/u/taylorswift)\
**Post date:** [July 4, 2022, 5:07pm UTC](https://forums.swift.org/t/swiftnio-channelinboundhandler-is-docc-incompatible/58611/8 "2022-07-04T17:07:27Z")

</div>

> [@franklin](#):
>
> but emitting the (non-underscored) synthesised symbols that originate from underscored protocols makes sense to me (like the SwiftNIO case discussed above).

just a nit, but the `_ChannelInboundHandler` methods aren’t synthesized symbols, they would only appear for concrete types that conform to `ChannelInboundHandler`. the problem here is `ChannelInboundHandler` implies a conformance to `_ChannelInboundHandler`, but DocC/Biome knows nothing about `_ChannelInboundHandler`, so it display its requirements.

---

<div class="post-metadata">

**Author:** ![taylorswift](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/taylorswift/32/43413_2.png) [@taylorswift](https://forums.swift.org/u/taylorswift)\
**Post date:** [July 8, 2022, 6:45pm UTC](https://forums.swift.org/t/swiftnio-channelinboundhandler-is-docc-incompatible/58611/9 "2022-07-08T18:45:55Z")

</div>

there is yet another blocker now, as members originating from underscored protocols are no longer being inherited at all: [GitHub issue](https://github.com/apple/swift/issues/59957)

---

<div class="post-metadata">

**Author:** ![taylorswift](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/taylorswift/32/43413_2.png) [@taylorswift](https://forums.swift.org/u/taylorswift)\
**Post date:** [July 20, 2022, 10:25pm UTC](https://forums.swift.org/t/swiftnio-channelinboundhandler-is-docc-incompatible/58611/10 "2022-07-20T22:25:43Z")

</div>

update: this has been partially unblocked by @QuietMisdreavus ’s [PR](https://github.com/apple/swift/pull/60096). thanks victoria!

---

<div class="post-metadata">

**Author:** ![QuietMisdreavus](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/quietmisdreavus/32/18057_2.png) [@QuietMisdreavus](https://forums.swift.org/u/QuietMisdreavus)\
**Post date:** [July 20, 2022, 10:35pm UTC](https://forums.swift.org/t/swiftnio-channelinboundhandler-is-docc-incompatible/58611/11 "2022-07-20T22:35:26Z")

</div>

To follow up: i've filed [apple/swift#60163](https://github.com/apple/swift/issues/60163) to track adding a flag when generating symbol graphs to include underscored and "unconditionally unavailable" symbols.
