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

tapir.docs.openapi.EndpointToOpenApiComponents.scala Maven / Gradle / Ivy

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

import tapir.docs.openapi.schema.SchemaKey
import tapir.openapi.OpenAPI.ReferenceOr
import tapir.openapi.{Schema => OSchema, _}

import scala.collection.immutable.ListMap

private[openapi] class EndpointToOpenApiComponents(
    keyToSchema: ListMap[SchemaKey, ReferenceOr[OSchema]],
    securitySchemes: SecuritySchemes
) {
  def components: Option[Components] = {
    if (keyToSchema.nonEmpty || securitySchemes.nonEmpty)
      Some(Components(keyToSchema, securitySchemes.values.toMap.mapValues(Right(_)).toListMap))
    else None
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy