12 lines
375 B
Scala
12 lines
375 B
Scala
package lu.foyer
|
|
|
|
import zio.schema.*
|
|
import zio.schema.annotation.discriminatorName
|
|
|
|
@discriminatorName("errorType")
|
|
enum JsonApiError derives Schema:
|
|
case NotFound(id: String)
|
|
case InternalServerError(e: String)
|
|
object JsonApiError:
|
|
given Schema[JsonApiError.NotFound] = DeriveSchema.gen
|
|
given Schema[JsonApiError.InternalServerError] = DeriveSchema.gen
|