foyer-dsi-assure-2035/core/src/lu/foyer/JsonApiError.scala

13 lines
375 B
Scala
Raw Normal View History

2025-10-22 15:30:36 +02:00
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