Skip to content

Commit

Permalink
Fix generating Tapir schemas for classes with more than 22 fields and…
Browse files Browse the repository at this point in the history
… that are recursive
  • Loading branch information
pwliwanow committed Apr 12, 2024
1 parent c270966 commit b30f920
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ object OpenApiZioSchemaToTapirConverter {
case Right(value) => value
}
}
addAnnotations(baseSchema, typedAnnotations)
addAnnotations(baseSchema, typedAnnotations, skipName = true)

case ZioSchema.Tuple(_, _, _) =>
???
Expand Down Expand Up @@ -352,10 +352,11 @@ object OpenApiZioSchemaToTapirConverter {

private def addAnnotations[A](
baseSchema: TapirSchema[A],
metadata: OpenApiParsedAnnotations[A]
metadata: OpenApiParsedAnnotations[A],
skipName: Boolean = false
): TapirSchema[A] = {
var result = baseSchema
if (metadata.entityName.isDefined) {
if (metadata.entityName.isDefined && !skipName) {
result = baseSchema.copy(name = metadata.entityName.map(schemaName))
}
if (metadata.description.isDefined) {
Expand Down

0 comments on commit b30f920

Please sign in to comment.