Skip to content

Commit

Permalink
Fix code OpenAPI documentation generator crashes on parameterized cas…
Browse files Browse the repository at this point in the history
…e classes
  • Loading branch information
Anshgrover23 committed Jun 14, 2024
1 parent 3feff56 commit cf34454
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions zio-schema/js/src/main/scala/zio/schema/StandardType.scala
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
package zio.schema

import zio.schema.{DeriveSchema, Schema, TypeId}
import zio.schema.Schema.Field
import java.math.BigInteger
import java.time
import java.time._

import zio.Chunk

case class Data[A](data: List[A])

object Data {
implicit def schema[A: Schema]: Schema[Data[A]] = {
Schema.CaseClass1[List[A], Data[A]](
TypeId.Structural,
Field("data", Schema[List[A]], get0 = _.data, set0 = (d, data) => d.copy(data = data)),
(data) => Data(data)
)
}
}

sealed trait StandardType[A] extends Ordering[A] { self =>
def tag: String
def defaultValue: Either[String, A]
Expand Down

0 comments on commit cf34454

Please sign in to comment.