Packages

  • package root
    Definition Classes
    root
  • package endpoints4s

    Definition Classes
    root
  • package algebra

    Algebra interfaces

    Algebra interfaces

    Definition Classes
    endpoints4s
  • package circe

    Interpreters producing Circe codecs

    Interpreters producing Circe codecs

    Definition Classes
    endpoints4s
  • package fetch
    Definition Classes
    endpoints4s
  • package generic

    Enriches algebras with operations performing generic derivation

    Enriches algebras with operations performing generic derivation

    Definition Classes
    endpoints4s
  • JsonSchemas
  • discriminator
  • docs
  • name
  • title
  • unnamed
  • package http4s

    Interpreters producing http4s clients and servers

    Interpreters producing http4s clients and servers

    Definition Classes
    endpoints4s
  • package openapi

    Interpreters producing an OpenAPI model of endpoints

    Interpreters producing an OpenAPI model of endpoints

    Definition Classes
    endpoints4s
  • package pekkohttp

    Interpreters producing Pekko-HTTP servers and clients

    Interpreters producing Pekko-HTTP servers and clients

    Definition Classes
    endpoints4s
  • package playjson

    Interpreters producing Play-JSON codecs

    Interpreters producing Play-JSON codecs

    Definition Classes
    endpoints4s
  • package sttp

    Client interpreter using Sttp

    Client interpreter using Sttp

    Definition Classes
    endpoints4s
  • package ujson

    Interpreters producing JSON codecs using ujson

    Interpreters producing JSON codecs using ujson

    Definition Classes
    endpoints4s

package generic

Enriches algebras with operations performing generic derivation

Source
package.scala
Linear Supertypes

Type Members

  1. trait JsonSchemas extends algebra.JsonSchemas

    Enriches JsonSchemas with two kinds of operations:

    Enriches JsonSchemas with two kinds of operations:

    • genericJsonSchema[A] derives the JsonSchema of an algebraic data type A;
    • (field1 :×: field2 :×: …).as[A] builds a tuple of Records and maps it to a case class A

    For instance, consider the following program that derives the JSON schema of a case class:

    case class User(name: String, age: Int)
    object User {
      implicit val schema: JsonSchema[User] = genericJsonSchema[User]
    }

    It is equivalent to the following:

    case class User(name: String, age: Int)
    object User {
      implicit val schema: JsonSchema[User] = (
        field[String]("name") zip
        field[Int]("age")
      ).xmap((User.apply _).tupled)(Function.unlift(User.unapply))
    }
  2. case class discriminator(name: String) extends Annotation with Product with Serializable

    Defines the name of the discriminator field of a generic tagged schema.

    Defines the name of the discriminator field of a generic tagged schema.

    Annotate a sealed trait definition with this annotation to define the name of its discriminator field.

    name

    Name of the tagged discriminator field

  3. case class docs(text: String) extends Annotation with Product with Serializable

    Adds a description to a case class field, a case class, or a sealed trait.

    Adds a description to a case class field, a case class, or a sealed trait.

    Annotate a case class field, case class, or sealed trait with this annotation to set a description for the schema or the record field.

    text

    Description of the annotated schema or field

  4. case class name(value: String) extends Annotation with Product with Serializable

    Defines the name of a generic schema.

    Defines the name of a generic schema.

    Annotate a sealed trait or case class definition with this annotation to define its schema name. Setting the name of a schema explicitly means that you can control exactly what the URI of the JSON schema will be in the OpenAPI documentation.

    value

    Name of the schema

    Note

    The name of the schema is used internally by OpenAPI in the URI that gets used to refer to the schema. Consequently, the name set here should include only characters allowed in URIs.

    See also

    Use title to customize the user-friendly name of the schema in the OpenAPI documentation

  5. case class title(value: String) extends Annotation with Product with Serializable

    Defines the title of a generic schema.

    Defines the title of a generic schema.

    Annotate a sealed trait or case class definition with this annotation to define its schema title.

  6. case class unnamed() extends Annotation with Product with Serializable

    Specifies that a generic schema should not have a name.

    Specifies that a generic schema should not have a name.

    Annotate a sealed trait or case class definition with this annotation to prevent the schema from being named. This is sometimes useful for forcing nested schemas to be inlined in OpenAPI documentation.

Inherited from AnyRef

Inherited from Any

Ungrouped