zio.http.gen.openapi

Members list

Type members

Classlikes

final case class Config(commonFieldsOnSuperType: Boolean, generateSafeTypeAliases: Boolean, fieldNamesNormalization: NormalizeFields, stringFormatTypes: Map[String, String])

Value parameters

commonFieldsOnSuperType

oneOf expressions in openapi result in sealed traits in generated scala code. if this flag is set to true, and all oneOf's "subtypes" are defined in terms of an allOf expression, and all share same object(s) included in the allOf expression, then the common fields from that shared object(s) will result in abstract fields defined on the sealed trait.

fieldNamesNormalization

OpenAPI can declare fields that have unconventional "casing" in scala, like snake_case, or kebab-case. This configuration allows to normalize these fields. The original casing will be preserved via a @fieldName(" ") annotation.

generateSafeTypeAliases

Referencing primitives, and giving them a name makes the openapi spec more readable. By default, the generated scala code will resolve the referenced name, and replace it with the primitive type. By setting this flag to true, the generator will create components with zio.prelude Newtype definitions wrapping over the aliased primitive type. Note: only aliased primitives are supported for now. TODO: in the future we can consider an enum instead of boolean for different aliased types. e.g: scala 3 opaque types, neotype, prelude's newtype, etc'…

Attributes

Companion
object
Source
Config.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Config

Attributes

Companion
class
Source
Config.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Config.type
object EndpointGen

Attributes

Companion
class
Source
EndpointGen.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
final case class EndpointGen(config: Config)

Attributes

Companion
object
Source
EndpointGen.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all