Why is StringValuesBuilder marked as @InternalAPI?...
# ktor
n
Why is StringValuesBuilder marked as @InternalAPI? It's used in Headers#build which is a public API
t
Because they don't want you to use the StringValuesBuilder directly externally, they want you to use the
HeadersBuilder
n
HeadersBuilder
also counts as @InternalAPI
n
yep, and with Kotlin 1.5.30-M1 I’m getting compilation errors when I use
append
in
HeadersBuilder
closure because of that.
Is it a compiler regression? 🤔
a
@Nikolay Kasyanov I think it's intended behavior. You can add
@OptIn(InternalAPI::class)
annotation to make an error go away. Btw,
InternalAPI
annotation will be removed in version 2.0.0.
n
@Aleksei Tirman [JB] Isn't it a breaking change? Are you sure they can just release it like it's nothing?
n
@Aleksei Tirman [JB] to clarify, are clients not supposed to use
Headers.build
at all? 🤔
most of the
HeadersBuilder
API surface is now an internal API, if it’s an intended change
the only usable thing I could find is the
HeadersBuilder.etag
extension method
(thanks for sharing the escape hatch via
@OptIn
though)
I’d appreciate a blessed way to build
Headers
instances that don’t rely on internal APIs, if there are any.
@Aleksei Tirman [JB]
Btw, InternalAPI  annotation will be removed in version 2.0.0.
Could you share please what the destiny of APIs currently marked with it would be?
a
It will stay wihout
InternalAPI
annotation, e.g. StringValuesBuilder.
🙏 1