All Downloads are FREE. Search and download functionalities are using the official Maven repository.

tapir.docs.openapi.schema.DiscriminatorToOpenApi.scala Maven / Gradle / Ivy

There is a newer version: 0.8.11
Show newest version
package tapir.docs.openapi.schema

import tapir.openapi.{Discriminator, _}
import tapir.{Schema => TSchema}

class DiscriminatorToOpenApi(schemaReferenceMapper: SchemaReferenceMapper) {
  def apply(discriminator: TSchema.Discriminator): Discriminator = {
    val schemas = Some(
      discriminator.mappingOverride.map { case (k, TSchema.SRef(fullName)) => k -> schemaReferenceMapper.map(fullName).$ref }.toListMap
    )
    Discriminator(discriminator.propertyName, schemas)
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy