Releases: endpoints4s/endpoints4s
1.11.1
Published for Scala 2.12, 2.13, 3.3 (for some artifacts only), Scala.js 1.12, and Scala Native 0.4.16.
See the binary compatibility guarantees for every module.
The version of the algebra modules is 1.11.1. Please refer to the table below for the corresponding version of the interpreters:
Artifact | Version | Dependencies |
---|---|---|
json-schema | 1.11.1 | |
json-schema-generic | 1.11.1 | shapeless:2.3.x |
json-schema-circe | 2.5.1 | circe:0.14.1 |
json-schema-playjson | 1.11.1 | play-json:2.9.3 |
algebra | 1.11.1 | |
algebra-circe | 2.5.1 | circe:0.14.1 |
algebra-playjson | 1.11.1 | play-json:2.9.3 |
openapi | 4.5.1 | ujson:1.4.x |
pekko-http-client | 1.0.1 | pekko:1.0.x, pekko-http:1.0.0 |
pekko-http-server | 1.0.1 | pekko:1.0.x, pekko-http:1.0.0 |
fetch-client | 3.2.1 | scalajs-dom:2.4.0 |
fetch-client-circe | 3.2.1 | scalajs-dom:2.4.0, circe: 0.14.1 |
http4s-client | 6.5.1 | http4s:0.23.6 |
http4s-server | 10.3.1 | http4s:0.23.6 |
sttp-client | 5.5.1 | sttp:3.3.18 |
What's Changed
- Test that authenticated endpoint’s URI match before validating the authentication credentials and fix the Pekko HTTP server interpreter implementation by @OlegYch in #1222
New Contributors
Full Changelog: v1.11.0...v1.11.1
1.11.0
Published for Scala 2.12, 2.13, 3.3 (for some artifacts only), Scala.js 1.12, and Scala Native 0.4.16.
See the binary compatibility guarantees for every module.
The version of the algebra modules is 1.11.0. Please refer to the table below for the corresponding version of the interpreters:
Artifact | Version | Dependencies |
---|---|---|
json-schema | 1.11.0 | |
json-schema-generic | 1.11.0 | shapeless:2.3.x |
json-schema-circe | 2.5.0 | circe:0.14.1 |
json-schema-playjson | 1.11.0 | play-json:2.9.3 |
algebra | 1.11.0 | |
algebra-circe | 2.5.0 | circe:0.14.1 |
algebra-playjson | 1.11.0 | play-json:2.9.3 |
openapi | 4.5.0 | ujson:1.4.x |
pekko-http-client | 1.0.0 | pekko:1.0.1, pekko-http:1.0.0 |
pekko-http-server | 1.0.0 | pekko:1.0.1, pekko-http:1.0.0 |
fetch-client | 3.2.0 | scalajs-dom:2.4.0 |
fetch-client-circe | 3.2.0 | scalajs-dom:2.4.0, circe: 0.14.1 |
http4s-client | 6.5.0 | http4s:0.23.6 |
http4s-server | 10.3.0 | http4s:0.23.6 |
sttp-client | 5.5.0 | sttp:3.3.18 |
What's Changed
- Add Pekko HTTP client and server interpreters by @ptrdom in #1207
- Introduce a
preciseField
JSON schema by @ant8e in #1194 - Make
OpenApi.jsonEncoder
public by @danarmak in #1204 - Publish Algebra and Pekko interpreters for Scala 3 by @ptrdom in #1210
- Update our own examples to use the fetch interpreters by @julienrf in #1214
New Contributors
Full Changelog: v1.10.0...v1.11.0
1.10.0
Published for Scala 2.12, 2.13, 3.1 (for some artifacts only), Scala.js 1.11, and Scala Native 0.4.
See the binary compatibility guarantees for every module.
The version of the algebra modules is 1.10.0. Please refer to the table below for the corresponding version of the interpreters:
Artifact | Version | Dependencies |
---|---|---|
json-schema | 1.10.0 | |
json-schema-generic | 1.10.0 | shapeless:2.3.10 |
json-schema-circe | 2.4.0 | circe:0.14.1 |
json-schema-playjson | 1.10.0 | play-json:2.9.3 |
algebra | 1.10.0 | |
algebra-circe | 2.4.0 | circe:0.14.1 |
algebra-playjson | 1.10.0 | play-json:2.9.3 |
openapi | 4.4.0 | ujson:1.4.0 |
akka-http-client | 5.4.0 | akka:2.6.17, akka-http:10.2.6 |
akka-http-server | 7.2.0 | akka:2.6.17, akka-http:10.2.6 |
fetch-client | 3.1.0 | scalajs-dom:2.4.0 |
fetch-client-circe | 3.1.0 | scalajs-dom:2.4.0, circe: 0.14.1 |
http4s-client | 6.4.0 | http4s:0.23.6 |
http4s-server | 10.2.0 | http4s:0.23.6 |
xhr-client | 5.3.0 | |
xhr-client-circe | 5.3.0 | circe:0.14.1 |
sttp-client | 5.4.0 | sttp:3.3.15 |
New Features
- #1136 Add 307 and 308 status codes (by @laurin-no)
- #1161 Support “tupling” values of types
A
and(B, C, D)
into a flat tuple(A, B, C, D)
- #1162 Add support for the
servers
field in OpenAPI documentation (by @emanb29)
Full Changelog: v1.9.0...v1.10.0
1.9.0
Published for Scala 2.12, 2.13, 3.1 (for some artifacts only), Scala.js 1.11, and Scala Native 0.4.
See the binary compatibility guarantees for every module.
The version of the algebra modules is 1.9.0. Please refer to the table below for the corresponding version of the interpreters:
Artifact | Version | Dependencies |
---|---|---|
json-schema | 1.9.0 | |
json-schema-generic | 1.9.0 | shapeless:2.3.10 |
json-schema-circe | 2.3.0 | circe:0.14.1 |
json-schema-playjson | 1.9.0 | play-json:2.9.3 |
algebra | 1.9.0 | |
algebra-circe | 2.3.0 | circe:0.14.1 |
algebra-playjson | 1.9.0 | play-json:2.9.3 |
openapi | 4.2.0 | ujson:1.4.0 |
akka-http-client | 5.3.0 | akka:2.6.17, akka-http:10.2.6 |
akka-http-server | 7.1.0 | akka:2.6.17, akka-http:10.2.6 |
fetch-client | 3.0.0 | scalajs-dom:2.3.0 |
fetch-client-circe | 3.0.0 | scalajs-dom:2.3.0, circe:0.14.1 |
http4s-client | 6.3.0 | http4s:0.23.6 |
http4s-server | 10.1.0 | http4s:0.23.6 |
xhr-client | 5.2.0 | |
xhr-client-circe | 5.2.0 | circe:0.14.1 |
sttp-client | 5.3.0 | sttp:3.3.15 |
New Features
Other Changes
Thanks to the help of @mleclercq and @ptrdom, we now publish Scala 3 artifacts for all the algebra modules, the Scala.js interpreters, and the http4s interpreters.
Full Changelog: v1.8.0...v1.9.0
1.8.0
Published for Scala 2.12, 2.13, Scala.js 1.8, and Scala Native 0.4.
See the binary compatibility guarantees for every module.
The version of the algebra modules is 1.8.0. Please refer to the table below for the corresponding version of the interpreters:
Artifact | Version | Dependencies |
---|---|---|
json-schema | 1.8.0 | |
json-schema-generic | 1.8.0 | shapeless:2.3.7 |
json-schema-circe | 2.2.0 | circe:0.14.1 |
json-schema-playjson | 1.8.0 | play-json:2.9.2 |
algebra | 1.8.0 | |
algebra-circe | 2.2.0 | circe:0.14.1 |
algebra-playjson | 1.8.0 | play-json:2.9.2 |
openapi | 4.2.0 | ujson:1.4.0 |
akka-http-client | 5.2.0 | akka:2.6.15, akka-http:10.2.6 |
akka-http-server | 7.0.0 | akka:2.6.15, akka-http:10.2.6 |
fetch-client | 2.1.0 | scalajs-dom:2.2.0 |
fetch-client-circe | 2.1.0 | scalajs-dom:2.2.0, circe:0.14.1 |
http4s-client | 6.2.0 | http4s:0.23.6 |
http4s-server | 10.0.0 | http4s:0.23.6 |
xhr-client | 5.1.0 | |
xhr-client-circe | 5.1.0 | circe:0.14.1 |
sttp-client | 5.2.0 | sttp:3.3.15 |
New Features
- #1017 Add methods
Validated.traverse
andValidated.sequence
(by @GerretS) - #1033 Add support for Scala Native to the modules
algebra-json-schema
andalgebra
(by @lolgab) - #1042 Add timeout support in client interpreters (by @romainreuillon)
Breaking Changes
1.7.0
Published for Scala 2.12 and 2.13, and Scala.js 1.7.
See the binary compatibility guarantees for every module.
The version of the algebra modules is 1.7.0. Please refer to the table below for the corresponding version of the interpreters:
Artifact | Version | Dependencies |
---|---|---|
json-schema | 1.7.0 | |
json-schema-generic | 1.7.0 | shapeless:2.3.7 |
json-schema-circe | 2.1.0 | circe:0.14.1 |
json-schema-playjson | 1.7.0 | play-json:2.9.2 |
algebra | 1.7.0 | |
algebra-circe | 2.1.0 | circe:0.14.1 |
algebra-playjson | 1.7.0 | play-json:2.9.2 |
openapi | 4.1.0 | ujson:1.4.0 |
akka-http-client | 5.1.0 | akka:2.6.15, akka-http:10.2.6 |
akka-http-server | 6.1.0 | akka:2.6.15, akka-http:10.2.6 |
fetch-client | 2.0.0 | scalajs-dom:2.1.0 |
fetch-client-circe | 2.0.0 | scalajs-dom:2.1.0, circe:0.14.1 |
http4s-client | 6.1.0 | http4s:0.23.6 |
http4s-server | 9.0.0 | http4s:0.23.6 |
xhr-client | 5.0.0 | |
xhr-client-circe | 5.0.0 | circe:0.14.1 |
sttp-client | 5.0.0 | sttp:3.3.15 |
New Features
- #979
xhr-client
andfetch-client
interpreters can now abort in-flight requests (by @ptrdom) - #972 Protocol improvements for
ChunkedEntities
(by @ptrdom)- The algebra has been split into
ChunkedRequestEntities
andChunkedResponseEntities
to account for interpreters that may not support request streaming (e.g., web browsers) - Chunks of JSON streams should now be explicitly “framed” to ensure that consumers read exactly the same amount of messages as sent by the writers. See the “Breaking Changes” section for an example.
- The algebra has been split into
Breaking Changes
-
Invoking an endpoint from an
xhr-client
interpreter orfetch-client
interpreter now requires an explicit call to.future
(or.thenable
) to get the result:- val eventualString: Future[String] = someResource(42) + val eventualString: Future[String] = someResource(42).future
-
You now have to explicitly provide a
Framing
strategy when streaming JSON entities. We provide anewLineDelimiterFraming
strategy out of the box, which delimits JSON frames within a text stream by new-line characters:endpoint( get(path / "notifications"), ok(jsonChunksResponse[Counter](newLineDelimiterFraming)) )
1.6.0
Published for Scala 2.12 and 2.13, and Scala.js 1.7.
See the binary compatibility guarantees for every module.
The version of the algebra modules is 1.6.0. Please refer to the table below for the corresponding version of the interpreters:
Artifact | Version | Dependencies |
---|---|---|
json-schema | 1.6.0 | |
json-schema-generic | 1.6.0 | shapeless:2.3.7 |
json-schema-circe | 2.0.0 | circe:0.14.1 |
json-schema-playjson | 1.6.0 | play-json:2.9.2 |
algebra | 1.6.0 | |
algebra-circe | 2.0.0 | circe:0.14.1 |
algebra-playjson | 1.6.0 | play-json:2.9.2 |
openapi | 4.0.0 | ujson:1.4.0 |
akka-http-client | 5.0.0 | akka:2.6.15, akka-http:10.2.6 |
akka-http-server | 6.0.0 | akka:2.6.15, akka-http:10.2.6 |
fetch-client | 1.0.0 | scalajs-dom:2.0.0 |
fetch-client-circe | 1.0.0 | scalajs-dom:2.0.0, circe:0.14.1 |
http4s-client | 6.0.0 | http4s:0.23.6 |
http4s-server | 8.0.0 | http4s:0.23.6 |
play-client | 4.0.0 | play:2.8.7 |
play-server | 4.0.0 | play:2.8.7 |
play-server-circe | 4.0.0 | play:2.8.7, circe:0.14.1 |
xhr-client | 4.0.0 | |
xhr-client-circe | 4.0.0 | circe:0.14.1 |
scalaj-client | 4.0.0 | scalaj-http:2.4.2 |
sttp-client | 5.0.0 | sttp:3.3.15 |
Highlights
Reusable transformation operations on endpoint descriptions with mapRequest
and mapResponse
You can now define reusable transformations for endpoint definitions with the operations mapRequest
, mapResponse
, and mapDocs
. Here is an example that transforms a simple endpoint into an endpoint protected by Basic HTTP authentication:
def withAuthentication[A, B](
endpoint: Endpoint[A, B]
): Endpoint[(A, String), Either[String, B]] =
endpoint
.mapRequest { (endpointRequest: Request[A]) =>
endpointRequest.addHeaders(requestHeader("Authorization"))
}
.mapResponse { (endpointResponse: Response[B]) =>
val unauthorizedResponse: Response[String] =
response(
Unauthorized,
emptyResponse,
headers = responseHeader("WWW-Authenticate")
)
unauthorizedResponse.orElse(endpointResponse)
}
val unauthenticatedEndpoint: Endpoint[Int, String] =
endpoint(
get(path / "foo" /? qs[Int]("n")),
ok(textResponse)
)
// Apply the transformation `withAuthentication` to the definition `unauthenticatedEndpoint`
// Note that the resulting endpoint now includes the credentials in the request (as a `String` value),
// and the possibility of not being authorized in the response (as a `Left` value).
val authenticatedEndpoint: Endpoint[(Int, String), Either[String, String]] =
withAuthentication(unauthenticatedEndpoint)
You can learn more about this feature in the documentation.
Streaming support for http4s intpreters
http4s client and server interpreters now support streamed entities via the implementation of the ChunkedEntities
algebra.
New Scala.js interpreter based on Fetch
A new Scala.js interpreter based on Fetch has been introduced, in addition to the existing one based on the XMLHttpRequest API. We expect the Fetch interpreter to better support streamed entities, eventually.
New Features
- #889 Add an option to not emit optional fields of JSON objects that have a default value (by @harpocrates)
- #893 Support decoding
NaN
,PositiveInfinity
, andNegativeInfinity
(by @harpocrates) - #925 Add support for modeling enumeration values with integers (by @ytalashko)
- #898 Add
mapRequest
andmapResponse
operations toEndpoint
(by @bmeesters and @mleclercq) - #874 Add implementation of
ChunkedEntities
to the http4s interpreters (by @GrafBlutwurst and @LukaJCB) - #939 http4s client interpreter is now available on the JS platform (by @armanbilge)
- #941 Support default values for query parameters (by @minedeljkovic)
- #934 Add Scala.js interpreter based on Fetch (by @ptrdom)
Bug Fixes
Breaking Changes
- #969 Akka-http interpreters now mark their dependency to
akka-stream
as provided. You have to explicitly depend on it, as described in the documentation - #916 circe dependency has been updated to 0.14.1 (by @MasseGuillaume). This affects circe interpreters only (these interpreters are suffixed with
-circe
) - the http4s-client interpreter now takes as parameters the scheme and authority of the service access, instead of the host. You can find an example of usage here.
- The
xhr
interpreters now has to be configured by providing someEndpointsSettings
. You can see an example here.
Other Changes
1.5.0
Published for Scala 2.12 and 2.13, and Scala.js 1.7.
See the binary compatibility guarantees for every module.
The version of the algebra modules is 1.5.0. Please refer to the table below for the corresponding version of the interpreters:
Artifact | Version | Dependencies |
---|---|---|
json-schema | 1.5.0 | |
json-schema-generic | 1.5.0 | shapeless:2.3.7 |
json-schema-circe | 1.5.0 | circe:0.13.0 |
json-schema-playjson | 1.5.0 | play-json:2.9.2 |
algebra | 1.5.0 | |
algebra-circe | 1.5.0 | circe:0.13.0 |
algebra-playjson | 1.5.0 | play-json:2.9.2 |
openapi | 3.1.0 | ujson:1.4.0 |
akka-http-client | 4.1.0 | akka:2.6.15, akka-http:10.2.5 |
akka-http-server | 5.1.0 | akka:2.6.15, akka-http:10.2.5 |
http4s-client | 5.0.0 | http4s:0.23.1 |
http4s-server | 7.0.0 | http4s:0.23.1 |
play-client | 3.1.0 | play:2.8.7 |
play-server | 3.1.0 | play:2.8.7 |
play-server-circe | 3.1.0 | play:2.8.7, circe:0.13.0 |
xhr-client | 3.1.0 | |
xhr-client-circe | 3.1.0 | circe:0.13.0 |
scalaj-client | 3.1.0 | scalaj-http:2.4.2 |
sttp-client | 4.1.0 | sttp:3.3.13 |
New Features
- #871 Document format of query and path parameters (by @minedeljkovic)
- #883 Preserve order of endpoints in OpenAPI documentation (by @bmeesters)
- #885 Improve support of reference schemas (by @harpocrates)
Bug Fixes
- #877 Make JSON schema of tuple types compatible with OpenAPI 3.0 (by @minedeljkovic)
- #881 Default values of optional JSON fields are now documented in the generated OpenAPI document (by @harpocrates)
Breaking Changes
algebra-1.4.0
Published for Scala 2.12 and 2.13, and Scala.js 1.6.
See the binary compatibility guarantees for every module.
The version of the algebra modules is 1.4.0. Please refer to the table below for the corresponding version of the interpreters:
Artifact | Version | Dependencies |
---|---|---|
json-schema | 1.4.0 | |
json-schema-generic | 1.4.0 | shapeless:2.3.7 |
json-schema-circe | 1.4.0 | circe:0.13.0 |
json-schema-playjson | 1.4.0 | play-json:2.9.2 |
algebra | 1.4.0 | |
algebra-circe | 1.4.0 | circe:0.13.0 |
algebra-playjson | 1.4.0 | play-json:2.9.2 |
openapi | 3.0.0 | ujson:1.4.0 |
akka-http-client | 4.0.0 | akka:2.6.15, akka-http:10.2.4 |
akka-http-server | 5.0.0 | akka:2.6.15, akka-http:10.2.4 |
http4s-client | 4.0.0 | http4s:0.21.24 |
http4s-server | 6.0.0 | http4s:0.21.24 |
play-client | 3.0.0 | play:2.8.7 |
play-server | 3.0.0 | play:2.8.7 |
play-server-circe | 3.0.0 | play:2.8.7, circe:0.13.0 |
xhr-client | 3.0.0 | |
xhr-client-circe | 3.0.0 | circe:0.13.0 |
scalaj-client | 3.0.0 | scalaj-http:2.4.2 |
sttp-client | 4.0.0 | sttp:3.3.9 |
New Features
- #742 Add support for trailing slashes in URLs (by @agboom)
- #839 Extend support of recursive JSON schemas (by @mleclercq)
Breaking Changes
- #755 Add a
Request
parameter to the methodshandleClientErrors
andhandleServerError
of the http4s-server interpreter (by @GrafBlutwurst) - #842 sttp interpreter now uses sttp3
Migration from endpoints4s 1.3.0
lazyTagged
and lazyRecord
have a new signature. Before:
case class Recursive(next: Option[Recursive])
val recursiveSchema: Record[Recursive] = (
optField("next")(lazyRecord(recursiveSchema, "Rec"))
).xmap(Recursive(_))(_.next)
After:
case class Recursive(next: Option[Recursive])
val recursiveSchema: Record[Recursive] =
lazyRecord("Rec")(
optField("next")(recursiveSchema)
).xmap(Recursive(_))(_.next)
algebra-1.3.0, http4s-server-5.0.0, akka-http-server-4.0.0, akka-http-client-3.0.0
Published for Scala 2.12 and 2.13, and Scala.js 1.3.
See the binary compatibility guarantees for every module.
New Features
- #684 Add support for constraints (
minimum
,maximum
, etc.) on JSON numbers (by @bmeesters) - #699 Add
JsonEntitiesFromEncodersAndDecoders
interpreter to thehttp4s-server
module (by @mleclercq) - #720 Provide JSON schemas for
Set
andMap
collections - #724 Add
JsonEntitiesFromSchemas
implementation to theplay-client
interpreter (by @marconilanna) - #727 Compress responses if the client supports it, in the
akka-http-server
module - #728 Add a method that returns an
Uri
to the typeEndpoint
in theakka-http-server
module
Bug Fixes
- #715 Fix ambiguous
Tupler
instances (by @blast-hardcheese)
Documentation improvements
- #732 Document the versions of Akka and Akka HTTP that the
akka-http-server
module depends on