Config

zio.http.gen.openapi.Config
See theConfig companion object
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
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Inherited methods

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product