Skip to content

Commit

Permalink
Release 1.10.13
Browse files Browse the repository at this point in the history
  • Loading branch information
adamw committed Jul 10, 2024
1 parent dd42b00 commit 6aab8d1
Show file tree
Hide file tree
Showing 69 changed files with 1,002 additions and 898 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ tapir documentation is available at [tapir.softwaremill.com](http://tapir.softwa
Add the following dependency:

```sbt
"com.softwaremill.sttp.tapir" %% "tapir-core" % "1.10.12"
"com.softwaremill.sttp.tapir" %% "tapir-core" % "1.10.13"
```

Then, import:
Expand Down
42 changes: 42 additions & 0 deletions generated-doc/out/_static/css/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/* general style for all example tags */
.example-tag {
border-width: 1px;
border-radius: 9999px;
border-style: solid;
padding-left: 0.5rem;
padding-right: 0.5rem;
margin-right: 0.25rem;
margin-top: 0.25rem;
margin-bottom: 0.25rem;
}

/* different colors for specific tags */
.example-effects {
color: rgb(193 21 116);
background-color: rgb(253 242 250);
border-color: rgb(252 206 238);
}

.example-json {
color: rgb(185 56 21);
background-color: rgb(254 246 238);
border-color: rgb(249 219 175);
}

.example-server {
color: rgb(6 118 71);
background-color: rgb(236 253 243);
border-color: rgb(169 239 197);
}

.example-docs {
color: rgb(52 64 84);
background-color: rgb(249 250 251);
border-color: rgb(234 236 240);
}

.example-client {
color: rgb(6 89 134);
background-color: rgb(240 249 255);
border-color: rgb(185 230 254);
}
43 changes: 43 additions & 0 deletions generated-doc/out/adopters.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Adopters

Is your company already using tapir? We're continually expanding the "adopters" section in the documentation; the more the merrier! It would be great to feature your company's logo, but in order to do that, we'll need written permission to avoid any legal misunderstandings.

Please email us at [[email protected]](mailto:[email protected]) from your company's email with a link to your logo (if we can use it, of course!) or with details who to kindly ask for permission to feature the logo in tapir's documentation. We'll handle the rest.

Thank you!

<div style="display: flex; justify-content: space-between; align-items: center;">
<a href="https://www.adobe.com" title="Adobe"><img src="https://github.com/softwaremill/tapir/raw/master/doc/adopters/adobe.png" alt="Adobe" width="160"/></a>
<a href="https://swisscom.com" title="Swisscom"><img src="https://github.com/softwaremill/tapir/raw/master/doc/adopters/swisscom.svg" alt="Swisscom" width="160"/></a>
<a href="https://swissborg.com" title="Swissborg"><img src="https://github.com/softwaremill/tapir/raw/master/doc/adopters/swissborg.png" alt="Swissborg" width="160"/></a>
</div>
<div style="display: flex; justify-content: space-between; align-items: center;">
<a href="https://kaizo.com" title="Kaizo"><img src="https://github.com/softwaremill/tapir/raw/master/doc/adopters/kaizo.png" alt="Kaizo" width="160"/></a>
<a href="https://www.process.st/" title="Process Street"><img src="https://github.com/softwaremill/tapir/raw/master/doc/adopters/process_street.png" alt="Process Street" width="100"/></a>
<a href="https://tranzzo.com" title="Tranzzo"><img src="https://github.com/softwaremill/tapir/raw/master/doc/adopters/tranzzo.svg" alt="Tranzzo" width="160"/></a>
</div>
<div style="display: flex; justify-content: space-between; align-items: center; margin-top:10px;">
<a href="https://www.kelkoogroup.com" title="Kelkoo group"><img src="https://github.com/softwaremill/tapir/raw/master/doc/adopters/kelkoogroup.png" alt="Kelkoo group" width="160"/></a>
<a href="https://www.softwaremill.com/" title="SoftwareMill"><img src="https://github.com/softwaremill/tapir/raw/master/doc/adopters/softwaremill.png" alt="SoftwareMill" width="160"/></a>
<a href="https://www.carvana.com" title="Carvana"><img src="https://github.com/softwaremill/tapir/raw/master/doc/adopters/carvana.svg" alt="Carvana" width="160"/></a>
</div>
<div style="display: flex; justify-content: space-between; align-items: center;">
<a href="https://www.moneyfarm.com" title="Moneyfarm"><img src="https://github.com/softwaremill/tapir/raw/master/doc/adopters/moneyfarm.png" alt="Moneyfarm" width="160"/></a>
<a href="https://www.ocadogroup.com/about-us/ocado-technology/" title="Ocado Technology"><img src="https://github.com/softwaremill/tapir/raw/master/doc/adopters/ocado.png" alt="Ocado" width="160"/></a>
<a href="https://www.wegtam.com" title="Wegtam"><img src="https://github.com/softwaremill/tapir/raw/master/doc/adopters/wegtam.svg" alt="Wegtam" width="160"/></a>
</div>
<div style="display: flex; justify-content: space-between; align-items: center; height: 100px;">
<a href="http://www.broad.app/" title="Broad"><img src="https://github.com/softwaremill/tapir/raw/master/doc/adopters/broad.png" alt="Broad" width="160"/></a>
<a href="https://www.kensu.io?utm_source=github&utm_campaign=tapir"><img src="https://github.com/softwaremill/tapir/raw/master/doc/adopters/kensu.png" alt="Kensu" width="160"/></a>
<a href="https://www.colisweb.com" title="Colisweb"><img src="https://github.com/softwaremill/tapir/raw/master/doc/adopters/colisweb.png" alt="Colisweb" width="160"/></a>
</div>
<div style="display: flex; justify-content: space-between; align-items: center; height: 100px;">
<a href="http://www.iceo.co/"><img src="https://github.com/softwaremill/tapir/raw/master/doc/adopters/iceo.png" alt="iceo" width="160"/></a>
<a href="http://www.dpgrecruitment.nl/"><img src="https://github.com/softwaremill/tapir/raw/master/doc/adopters/dpg-recruitment.svg" alt="dpg" width="160"/></a>
<a href="https://www.hunters.security/"><img src="https://github.com/softwaremill/tapir/raw/master/doc/adopters/hunters.png" alt="hunters" width="160"/></a>
</div>
<div style="display: flex; justify-content: space-between; align-items: center; height: 100px;">
<a href="https://www.moia.io/en"><img src="https://github.com/softwaremill/tapir/raw/master/doc/adopters/moia.png" alt="moia" width="160"/></a>
<a href="https://www.pitsdatarecovery.net"><img src="https://github.com/softwaremill/tapir/raw/master/doc/adopters/pits.svg" alt="pits" width="100"/></a>
<a href="https://www.hootsuite.com"><img src="https://github.com/softwaremill/tapir/raw/master/doc/adopters/hootsuite.png" alt="hootsuite" width="160"/></a>
</div>
2 changes: 1 addition & 1 deletion generated-doc/out/client/http4s.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Add the dependency:

```scala
"com.softwaremill.sttp.tapir" %% "tapir-http4s-client" % "1.10.12"
"com.softwaremill.sttp.tapir" %% "tapir-http4s-client" % "1.10.13"
```

To interpret an endpoint definition as an `org.http4s.Request[F]`, import:
Expand Down
9 changes: 4 additions & 5 deletions generated-doc/out/client/play.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ See the [Play framework documentation](https://www.playframework.com/documentati
For **Play 3.0**, add the dependency:

```scala
"com.softwaremill.sttp.tapir" %% "tapir-play-client" % "1.10.12"
"com.softwaremill.sttp.tapir" %% "tapir-play-client" % "1.10.13"
```

For **Play 2.9**, add

```scala
"com.softwaremill.sttp.tapir" %% "tapir-play29-client" % "1.10.12"
"com.softwaremill.sttp.tapir" %% "tapir-play29-client" % "1.10.13"
```

instead. Furthermore, replace all uses of `sttp.capabilities.pekko.PekkoStreams` in the following code snippets with `sttp.capabilities.akka.AkkaStreams`.
Expand Down Expand Up @@ -51,7 +51,7 @@ After providing the input parameters, the two following are returned:
Example:

```scala
import sttp.tapir._
import sttp.tapir.*
import sttp.tapir.client.play.PlayClientInterpreter
import sttp.capabilities.pekko.PekkoStreams

Expand All @@ -60,7 +60,7 @@ import scala.concurrent.Future

import play.api.libs.ws.StandaloneWSClient

def example[I, E, O, R >: PekkoStreams](implicit wsClient: StandaloneWSClient) {
def example[I, E, O, R >: PekkoStreams](implicit wsClient: StandaloneWSClient): Unit =
val e: PublicEndpoint[I, E, O, R] = ???
val inputArgs: I = ???

Expand All @@ -71,7 +71,6 @@ def example[I, E, O, R >: PekkoStreams](implicit wsClient: StandaloneWSClient) {
val result: Future[Either[E, O]] = req
.execute()
.map(responseParser)
}
```

## Limitations
Expand Down
16 changes: 8 additions & 8 deletions generated-doc/out/client/sttp.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Add the dependency:

```scala
"com.softwaremill.sttp.tapir" %% "tapir-sttp-client" % "1.10.12"
"com.softwaremill.sttp.tapir" %% "tapir-sttp-client" % "1.10.13"
```

To make requests using an endpoint definition using the [sttp client](https://github.com/softwaremill/sttp), import:
Expand Down Expand Up @@ -66,10 +66,10 @@ convert sttp's `WebSocket` instance into a pipe. This logic is looked up via the
The required imports are as follows:

```scala
import sttp.tapir.client.sttp.ws.pekkohttp._ // for pekko-streams
import sttp.tapir.client.sttp.ws.akkahttp._ // for akka-streams
import sttp.tapir.client.sttp.ws.fs2._ // for fs2
import sttp.tapir.client.sttp.ws.zio._ // for zio
import sttp.tapir.client.sttp.ws.pekkohttp.* // for pekko-streams
import sttp.tapir.client.sttp.ws.akkahttp.* // for akka-streams
import sttp.tapir.client.sttp.ws.fs2.* // for fs2
import sttp.tapir.client.sttp.ws.zio.* // for zio
```

No additional dependencies are needed, as both of the above implementations are included in the main interpreter,
Expand All @@ -85,9 +85,9 @@ If you'd like to skip that step, e.g. when testing redirects, it's possible to o
description, for example:

```scala :compile-only
import sttp.tapir._
import sttp.tapir.*
import sttp.tapir.client.sttp.SttpClientInterpreter
import sttp.client3._
import sttp.client3.*

SttpClientInterpreter()
.toRequest(endpoint.get.in("hello").in(query[String]("name")), Some(uri"http://localhost:8080"))
Expand All @@ -101,7 +101,7 @@ In this case add the following dependencies (note the [`%%%`](https://www.scala-
instead of the usual `%%`):

```scala
"com.softwaremill.sttp.tapir" %%% "tapir-sttp-client" % "1.10.12"
"com.softwaremill.sttp.tapir" %%% "tapir-sttp-client" % "1.10.13"
"io.github.cquiroz" %%% "scala-java-time" % "2.2.0" // implementations of java.time classes for Scala.JS
```

Expand Down
6 changes: 6 additions & 0 deletions generated-doc/out/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

# These paths are either relative to html_static_path
# or fully qualified paths (eg. https://...)
html_css_files = [
'css/custom.css',
]

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
Expand Down
20 changes: 10 additions & 10 deletions generated-doc/out/docs/asyncapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
To use, add the following dependencies:

```scala
"com.softwaremill.sttp.tapir" %% "tapir-asyncapi-docs" % "1.10.12"
"com.softwaremill.sttp.tapir" %% "tapir-asyncapi-docs" % "1.10.13"
"com.softwaremill.sttp.apispec" %% "asyncapi-circe-yaml" % "..." // see https://github.com/softwaremill/sttp-apispec
```

Expand All @@ -15,16 +15,16 @@ object:

```scala
import sttp.apispec.asyncapi.AsyncAPI
import sttp.capabilities.akka.AkkaStreams
import sttp.tapir._
import sttp.capabilities.pekko.PekkoStreams
import sttp.tapir.*
import sttp.tapir.docs.asyncapi.AsyncAPIInterpreter
import sttp.tapir.generic.auto._
import sttp.tapir.json.circe._
import io.circe.generic.auto._
import sttp.tapir.generic.auto.*
import sttp.tapir.json.circe.*
import io.circe.generic.auto.*

case class Response(msg: String, count: Int)
val echoWS = endpoint.out(
webSocketBody[String, CodecFormat.TextPlain, Response, CodecFormat.Json](AkkaStreams))
webSocketBody[String, CodecFormat.TextPlain, Response, CodecFormat.Json](PekkoStreams))

val docs: AsyncAPI = AsyncAPIInterpreter().toAsyncAPI(echoWS, "Echo web socket", "1.0")
```
Expand Down Expand Up @@ -56,7 +56,7 @@ Multiple endpoints can be converted to an `AsyncAPI` instance by calling the met
The asyncapi case classes can then be serialised, either to JSON or YAML using [Circe](https://circe.github.io/circe/):

```scala
import sttp.apispec.asyncapi.circe.yaml._
import sttp.apispec.asyncapi.circe.yaml.*

println(docs.toYaml)
```
Expand Down Expand Up @@ -84,7 +84,7 @@ Specification extensions can be added by first importing an extension method, an
method which manipulates the appropriate attribute on the schema, endpoint or endpoint input/output:

```scala
import sttp.tapir.docs.apispec.DocsExtensionAttribute._
import sttp.tapir.docs.apispec.DocsExtensionAttribute.*

endpoint
.post
Expand All @@ -97,4 +97,4 @@ look at **OpenAPI Specification Extensions** section of [documentation](../docs/

## Exposing AsyncAPI documentation

AsyncAPI documentation can be exposed through the [AsyncAPI playground](https://playground.asyncapi.io).
AsyncAPI documentation can be exposed through the [AsyncAPI playground](https://playground.asyncapi.io).
72 changes: 36 additions & 36 deletions generated-doc/out/docs/json-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,29 @@
You can conveniently generate JSON schema from Tapir schema, which can be derived from your Scala types. Use `TapirSchemaToJsonSchema`:

```scala
"com.softwaremill.sttp.tapir" %% "tapir-apispec-docs" % "1.10.12"
"com.softwaremill.sttp.tapir" %% "tapir-apispec-docs" % "1.10.13"
```

Schema generation can now be performed like in the following example:

```scala
import sttp.apispec.{Schema => ASchema}
import sttp.tapir._
import sttp.tapir.docs.apispec.schema._
import sttp.tapir.generic.auto._
import sttp.tapir.*
import sttp.tapir.docs.apispec.schema.*
import sttp.tapir.generic.auto.*

object Childhood {
case class Child(age: Int, height: Option[Int])
}
case class Parent(innerChildField: Child, childDetails: Childhood.Child)
case class Child(childName: String) // to illustrate unique name generation
val tSchema = implicitly[Schema[Parent]]

val jsonSchema: ASchema = TapirSchemaToJsonSchema(
tSchema,
markOptionsAsNullable = true,
metaSchema = MetaSchemaDraft04 // default
// schemaName = sttp.atpir.docs.apispec.defaultSchemaName // default
object Childhood {
case class Child(age: Int, height: Option[Int])
}
case class Parent(innerChildField: Child, childDetails: Childhood.Child)
case class Child(childName: String) // to illustrate unique name generation
val tSchema = implicitly[Schema[Parent]]

val jsonSchema: ASchema = TapirSchemaToJsonSchema(
tSchema,
markOptionsAsNullable = true,
metaSchema = MetaSchemaDraft04 // default
// schemaName = sttp.atpir.docs.apispec.defaultSchemaName // default
)
```

Expand All @@ -42,28 +42,28 @@ you will get a codec for `sttp.apispec.Schema`:

```scala
import io.circe.Printer
import io.circe.syntax._
import sttp.apispec.circe._
import sttp.apispec.{Schema => ASchema, SchemaType => ASchemaType}
import sttp.tapir._
import sttp.tapir.docs.apispec.schema._
import sttp.tapir.generic.auto._
import io.circe.syntax.*
import sttp.apispec.circe.*
import sttp.apispec.{Schema => ASchema}
import sttp.tapir.*
import sttp.tapir.docs.apispec.schema.*
import sttp.tapir.generic.auto.*
import sttp.tapir.Schema.annotations.title

object Childhood {
@title("my child") case class Child(age: Int, height: Option[Int])
}
case class Parent(innerChildField: Child, childDetails: Childhood.Child)
case class Child(childName: String)
val tSchema = implicitly[Schema[Parent]]

val jsonSchema: ASchema = TapirSchemaToJsonSchema(
tSchema,
markOptionsAsNullable = true)
// JSON serialization
val schemaAsJson = jsonSchema.asJson
val schemaStr: String = Printer.spaces2.print(schemaAsJson.deepDropNullValues)
object Childhood {
@title("my child") case class Child(age: Int, height: Option[Int])
}
case class Parent(innerChildField: Child, childDetails: Childhood.Child)
case class Child(childName: String)
val tSchema = implicitly[Schema[Parent]]

val jsonSchema: ASchema = TapirSchemaToJsonSchema(
tSchema,
markOptionsAsNullable = true)

// JSON serialization
val schemaAsJson = jsonSchema.asJson
val schemaStr: String = Printer.spaces2.print(schemaAsJson.deepDropNullValues)
```

The title annotation of the object will be by default the name of the case class. You can customize it with `@title` annotation.
Expand Down
Loading

0 comments on commit 6aab8d1

Please sign in to comment.