This is an automated email from the ASF dual-hosted git repository.
pjfanning pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pekko-http.git
The following commit(s) were added to refs/heads/main by this push:
new 434f75bb6 Remove ApiMayChange from client transport, request/response
association and directive APIs (#1364)
434f75bb6 is described below
commit 434f75bb62c717a3f07c6171c58e7da53296a5c3
Author: PJ Fanning <[email protected]>
AuthorDate: Fri Oct 23 17:24:49 2026 +0100
Remove ApiMayChange from client transport, request/response association and
directive APIs (#1364)
* remove ApiMayChange from long-standing client transport, request/response
association and directive APIs
Motivation:
ClientTransport, RequestResponseAssociation, SimpleRequestResponseAttribute,
the javadsl anyOf/allOf directive combinators and the storeUploadedFile(s) /
fileUploadAll directives have been marked @ApiMayChange since Akka HTTP 10.x
and have been stable in practice. Akka HTTP 10.6.0 dropped these
annotations.
Modification:
Remove the @ApiMayChange annotations (and now-unused imports), drop the
"(Still unstable)" wording from the ClientTransport scaladoc, and remove the
"API may still change" note from the client transport docs page.
Result:
These APIs are declared stable for Pekko HTTP 2.0.0. Annotation-only change;
no binary or behavioral impact.
Tests:
- scalafmt --mode diff-ref=upstream/main: no changes
- sbt http-core/compile http/compile: pass
- sbt http-core/mimaReportBinaryIssues http/mimaReportBinaryIssues: pass
- No directional test added: annotation and doc-only change with no
behavior to assert
References:
Refs akka/akka-http#4315 (Apache 2.0 since the Akka HTTP 10.6.0 change
date, 2026-10-23)
* update Lightbend copyright years on files with ported Akka HTTP 10.6.0
code
The ported changes are from Akka HTTP 10.6.0, so these files take the
Lightbend copyright line of the same files in akka-http v10.6.0, as done
for earlier ports (#961, #1016).
Tests:
- sbt headerCheck / Test/headerCheck for the touched modules: pass
References:
None - license header follow-up for this port
---
docs/src/main/paradox/client-side/client-transport.md | 2 +-
.../scala/org/apache/pekko/http/javadsl/ClientTransport.scala | 9 +++------
.../pekko/http/javadsl/model/RequestResponseAssociation.scala | 4 +---
.../scala/org/apache/pekko/http/scaladsl/ClientTransport.scala | 9 +++------
.../pekko/http/scaladsl/model/RequestResponseAssociation.scala | 5 +----
.../scala/org/apache/pekko/http/javadsl/server/Directives.scala | 8 +-------
.../http/javadsl/server/directives/FileUploadDirectives.scala | 6 +-----
.../http/scaladsl/server/directives/FileUploadDirectives.scala | 7 ++-----
8 files changed, 13 insertions(+), 37 deletions(-)
diff --git a/docs/src/main/paradox/client-side/client-transport.md
b/docs/src/main/paradox/client-side/client-transport.md
index 54b572231..d9f682a4e 100644
--- a/docs/src/main/paradox/client-side/client-transport.md
+++ b/docs/src/main/paradox/client-side/client-transport.md
@@ -1,6 +1,6 @@
# Pluggable Client Transports / HTTP(S) proxy Support
-The client side infrastructure has support to plug different transport
mechanisms underneath (the API may still change in the future). A client side
+The client side infrastructure has support to plug different transport
mechanisms underneath. A client side
transport is represented by an instance of
@scala[@scaladoc[org.apache.pekko.http.scaladsl.ClientTransport](org.apache.pekko.http.scaladsl.ClientTransport)]@java[@javadoc[org.apache.pekko.http.javadsl.ClientTransport](org.apache.pekko.http.javadsl.ClientTransport)]:
diff --git
a/http-core/src/main/scala/org/apache/pekko/http/javadsl/ClientTransport.scala
b/http-core/src/main/scala/org/apache/pekko/http/javadsl/ClientTransport.scala
index 50eb1cbee..63ff5bb46 100644
---
a/http-core/src/main/scala/org/apache/pekko/http/javadsl/ClientTransport.scala
+++
b/http-core/src/main/scala/org/apache/pekko/http/javadsl/ClientTransport.scala
@@ -8,7 +8,7 @@
*/
/*
- * Copyright (C) 2009-2022 Lightbend Inc. <https://www.lightbend.com>
+ * Copyright (C) 2009-2023 Lightbend Inc. <https://www.lightbend.com>
*/
package org.apache.pekko.http.javadsl
@@ -19,7 +19,6 @@ import java.util.function.BiFunction
import org.apache.pekko
import pekko.actor.ActorSystem
-import pekko.annotation.ApiMayChange
import pekko.http.impl.util.JavaMapping
import pekko.http.impl.util.JavaMapping.Implicits._
import pekko.http.impl.util.JavaMapping._
@@ -31,10 +30,9 @@ import pekko.util.ByteString
import scala.concurrent.Future
/**
- * (Still unstable) SPI for implementors of custom client transports.
+ * SPI for implementors of custom client transports.
*/
// #client-transport-definition
-@ApiMayChange
abstract class ClientTransport {
def connectTo(host: String, port: Int, settings: ClientConnectionSettings,
system: ActorSystem)
: Flow[ByteString, ByteString, CompletionStage[OutgoingConnection]]
@@ -42,9 +40,8 @@ abstract class ClientTransport {
// #client-transport-definition
/**
- * (Still unstable) entry point to create or access predefined client
transports.
+ * Entry point to create or access predefined client transports.
*/
-@ApiMayChange
object ClientTransport {
def TCP: ClientTransport = scaladsl.ClientTransport.TCP.asJava
diff --git
a/http-core/src/main/scala/org/apache/pekko/http/javadsl/model/RequestResponseAssociation.scala
b/http-core/src/main/scala/org/apache/pekko/http/javadsl/model/RequestResponseAssociation.scala
index a2ede1638..2484e5a90 100644
---
a/http-core/src/main/scala/org/apache/pekko/http/javadsl/model/RequestResponseAssociation.scala
+++
b/http-core/src/main/scala/org/apache/pekko/http/javadsl/model/RequestResponseAssociation.scala
@@ -8,7 +8,7 @@
*/
/*
- * Copyright (C) 2020-2022 Lightbend Inc. <https://www.lightbend.com>
+ * Copyright (C) 2020-2023 Lightbend Inc. <https://www.lightbend.com>
*/
package org.apache.pekko.http.javadsl.model
@@ -16,12 +16,10 @@ package org.apache.pekko.http.javadsl.model
import java.util.concurrent.CompletableFuture
import org.apache.pekko
-import pekko.annotation.ApiMayChange
/**
* A marker trait for attribute values that should be (automatically) carried
over from request to response.
*/
-@ApiMayChange
trait RequestResponseAssociation
/**
diff --git
a/http-core/src/main/scala/org/apache/pekko/http/scaladsl/ClientTransport.scala
b/http-core/src/main/scala/org/apache/pekko/http/scaladsl/ClientTransport.scala
index d1d57ecfc..0b912276e 100644
---
a/http-core/src/main/scala/org/apache/pekko/http/scaladsl/ClientTransport.scala
+++
b/http-core/src/main/scala/org/apache/pekko/http/scaladsl/ClientTransport.scala
@@ -8,7 +8,7 @@
*/
/*
- * Copyright (C) 2009-2022 Lightbend Inc. <https://www.lightbend.com>
+ * Copyright (C) 2009-2023 Lightbend Inc. <https://www.lightbend.com>
*/
package org.apache.pekko.http.scaladsl
@@ -17,7 +17,6 @@ import java.net.InetSocketAddress
import org.apache.pekko
import pekko.actor.ActorSystem
-import pekko.annotation.ApiMayChange
import pekko.http.impl.engine.client.HttpsProxyGraphStage
import pekko.http.scaladsl.Http.OutgoingConnection
import pekko.http.scaladsl.model.headers.HttpCredentials
@@ -31,10 +30,9 @@ import scala.concurrent.{ ExecutionContext, Future }
/**
* Abstraction to allow the creation of alternative transports to run HTTP on.
*
- * (Still unstable) SPI for implementors of custom client transports.
+ * SPI for implementors of custom client transports.
*/
// #client-transport-definition
-@ApiMayChange
trait ClientTransport {
def connectTo(host: String, port: Int, settings: ClientConnectionSettings)(
implicit system: ActorSystem): Flow[ByteString, ByteString,
Future[OutgoingConnection]]
@@ -42,9 +40,8 @@ trait ClientTransport {
// #client-transport-definition
/**
- * (Still unstable) entry point to create or access predefined client
transports.
+ * Entry point to create or access predefined client transports.
*/
-@ApiMayChange
object ClientTransport {
val TCP: ClientTransport = TCPTransport
diff --git
a/http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/RequestResponseAssociation.scala
b/http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/RequestResponseAssociation.scala
index 815c07506..d8e6c72db 100644
---
a/http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/RequestResponseAssociation.scala
+++
b/http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/RequestResponseAssociation.scala
@@ -8,13 +8,12 @@
*/
/*
- * Copyright (C) 2020-2022 Lightbend Inc. <https://www.lightbend.com>
+ * Copyright (C) 2020-2023 Lightbend Inc. <https://www.lightbend.com>
*/
package org.apache.pekko.http.scaladsl.model
import org.apache.pekko
-import pekko.annotation.ApiMayChange
import pekko.annotation.InternalStableApi
import scala.concurrent.Promise
@@ -22,14 +21,12 @@ import scala.concurrent.Promise
/**
* A marker trait for attribute values that should be (automatically) carried
over from request to response.
*/
-@ApiMayChange
@InternalStableApi
trait RequestResponseAssociation extends
pekko.http.javadsl.model.RequestResponseAssociation
/**
* A simple value holder class implementing RequestResponseAssociation.
*/
-@ApiMayChange
final case class SimpleRequestResponseAttribute[T](value: T) extends
RequestResponseAssociation
/**
diff --git
a/http/src/main/scala/org/apache/pekko/http/javadsl/server/Directives.scala
b/http/src/main/scala/org/apache/pekko/http/javadsl/server/Directives.scala
index a047b484d..e755b3173 100644
--- a/http/src/main/scala/org/apache/pekko/http/javadsl/server/Directives.scala
+++ b/http/src/main/scala/org/apache/pekko/http/javadsl/server/Directives.scala
@@ -8,7 +8,7 @@
*/
/*
- * Copyright (C) 2009-2022 Lightbend Inc. <https://www.lightbend.com>
+ * Copyright (C) 2009-2023 Lightbend Inc. <https://www.lightbend.com>
*/
package org.apache.pekko.http.javadsl.server
@@ -18,7 +18,6 @@ import java.util.function.{ BiFunction, Function, Supplier }
import scala.annotation.varargs
import org.apache.pekko
-import pekko.annotation.ApiMayChange
import pekko.http.javadsl.server.directives.FramedEntityStreamingDirectives
abstract class AllDirectives extends FramedEntityStreamingDirectives
@@ -46,7 +45,6 @@ object Directives extends AllDirectives {
* @param inner the inner route Producer
* @return the resulting route
*/
- @ApiMayChange
def anyOf(first: Function[Supplier[Route], Route], second:
Function[Supplier[Route], Route], inner: Supplier[Route])
: Route = {
first.apply(inner).orElse(second.apply(inner))
@@ -64,7 +62,6 @@ object Directives extends AllDirectives {
* @tparam A the type of the parameter the directives extract and the inner
route takes
* @return the resulting route
*/
- @ApiMayChange
def anyOf[A](first: Function[Function[A, Route], Route], second:
Function[Function[A, Route], Route],
inner: Function[A, Route]): Route = {
first.apply(inner).orElse(second.apply(inner))
@@ -79,7 +76,6 @@ object Directives extends AllDirectives {
* @param inner the inner route function
* @return the resulting route
*/
- @ApiMayChange
def allOf(first: Function[Supplier[Route], Route], second:
Function[Supplier[Route], Route], inner: Supplier[Route])
: Route = {
first.apply(() => second.apply(inner))
@@ -96,7 +92,6 @@ object Directives extends AllDirectives {
* @tparam B the type extracted from the second directive
* @return the resulting route
*/
- @ApiMayChange
def allOf[A, B](first: Function[Function[A, Route], Route], second:
Function[Function[B, Route], Route],
inner: BiFunction[A, B, Route]): Route = {
first.apply((a: A) => second.apply((b: B) => inner.apply(a, b)))
@@ -112,7 +107,6 @@ object Directives extends AllDirectives {
* @tparam A the type extracted from the second directive
* @return the resulting route
*/
- @ApiMayChange
def allOf[A](first: Function[Supplier[Route], Route], second:
Function[Function[A, Route], Route],
inner: Function[A, Route]): Route = {
first.apply(() => second.apply((a: A) => inner.apply(a)))
diff --git
a/http/src/main/scala/org/apache/pekko/http/javadsl/server/directives/FileUploadDirectives.scala
b/http/src/main/scala/org/apache/pekko/http/javadsl/server/directives/FileUploadDirectives.scala
index c1181ffb3..47e109769 100644
---
a/http/src/main/scala/org/apache/pekko/http/javadsl/server/directives/FileUploadDirectives.scala
+++
b/http/src/main/scala/org/apache/pekko/http/javadsl/server/directives/FileUploadDirectives.scala
@@ -8,7 +8,7 @@
*/
/*
- * Copyright (C) 2009-2022 Lightbend Inc. <https://www.lightbend.com>
+ * Copyright (C) 2009-2023 Lightbend Inc. <https://www.lightbend.com>
*/
package org.apache.pekko.http.javadsl.server.directives
@@ -19,7 +19,6 @@ import java.util.AbstractMap.SimpleImmutableEntry
import java.util.function.{ BiFunction, Function => JFunction }
import org.apache.pekko
-import pekko.annotation.ApiMayChange
import pekko.http.javadsl.model.ContentType
import pekko.http.javadsl.server.Route
import pekko.http.scaladsl.server.{ Directives => D }
@@ -35,7 +34,6 @@ abstract class FileUploadDirectives extends
FileAndResourceDirectives {
* field the request will be rejected, if there are multiple file parts with
the same name, the first one will be
* used and the subsequent ones ignored.
*/
- @ApiMayChange
def storeUploadedFile(
fieldName: String, destFn: JFunction[FileInfo, File], inner:
BiFunction[FileInfo, File, Route]): Route =
RouteAdapter {
@@ -47,7 +45,6 @@ abstract class FileUploadDirectives extends
FileAndResourceDirectives {
* If there is an error writing to disk the request will be failed with the
thrown exception, if there is no such
* field the request will be rejected. Stored files are cleaned up on exit
but not on failure.
*/
- @ApiMayChange
def storeUploadedFiles(fieldName: String, destFn: JFunction[FileInfo, File],
inner: JFunction[JList[JMap.Entry[FileInfo, File]], Route]): Route =
RouteAdapter {
D.storeUploadedFiles(fieldName, destFn.apply) { files =>
@@ -72,7 +69,6 @@ abstract class FileUploadDirectives extends
FileAndResourceDirectives {
* Files are buffered into temporary files on disk so in-memory buffers
don't overflow. The temporary
* files are cleaned up once materialized, or on exit if the stream is not
consumed.
*/
- @ApiMayChange
def fileUploadAll(
fieldName: String, inner: JFunction[JList[JMap.Entry[FileInfo,
Source[ByteString, Any]]], Route]): Route =
RouteAdapter {
diff --git
a/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/FileUploadDirectives.scala
b/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/FileUploadDirectives.scala
index b8ab91b87..d470e5b4b 100644
---
a/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/FileUploadDirectives.scala
+++
b/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/FileUploadDirectives.scala
@@ -8,7 +8,7 @@
*/
/*
- * Copyright (C) 2015-2022 Lightbend Inc. <https://www.lightbend.com>
+ * Copyright (C) 2015-2023 Lightbend Inc. <https://www.lightbend.com>
*/
package org.apache.pekko.http.scaladsl.server.directives
@@ -22,7 +22,7 @@ import scala.util.{ Failure, Success }
import org.apache.pekko
import pekko.Done
import pekko.actor.{ CoordinatedShutdown, ExtendedActorSystem, Extension,
ExtensionId }
-import pekko.annotation.{ ApiMayChange, InternalApi }
+import pekko.annotation.InternalApi
import pekko.http.impl.util.StreamUtils
import pekko.http.javadsl
import pekko.http.scaladsl.model.{ ContentType, Multipart }
@@ -49,7 +49,6 @@ trait FileUploadDirectives {
*
* @group fileupload
*/
- @ApiMayChange
def storeUploadedFile(fieldName: String, destFn: FileInfo => File):
Directive[(FileInfo, File)] =
extractRequestContext.flatMap { ctx =>
import ctx.executionContext
@@ -80,7 +79,6 @@ trait FileUploadDirectives {
*
* @group fileupload
*/
- @ApiMayChange
def storeUploadedFiles(fieldName: String, destFn: FileInfo => File):
Directive1[Seq[(FileInfo, File)]] =
entity(as[Multipart.FormData]).flatMap { formData =>
extractRequestContext.flatMap { ctx =>
@@ -169,7 +167,6 @@ trait FileUploadDirectives {
*
* @group fileupload
*/
- @ApiMayChange
def fileUploadAll(fieldName: String): Directive1[Seq[(FileInfo,
Source[ByteString, Any])]] =
extractRequestContext.flatMap { ctx =>
implicit val ec = ctx.executionContext
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]