diff --git a/zio-http/src/main/scala/zio/http/endpoint/openapi/JsonSchema.scala b/zio-http/src/main/scala/zio/http/endpoint/openapi/JsonSchema.scala index abb6642845..04d37a4d89 100644 --- a/zio-http/src/main/scala/zio/http/endpoint/openapi/JsonSchema.scala +++ b/zio-http/src/main/scala/zio/http/endpoint/openapi/JsonSchema.scala @@ -346,12 +346,11 @@ object JsonSchema { val key = nominal(c.schema, refType) .orElse(nominal(c.schema, SchemaStyle.Compact)) - .getOrElse(throw new Exception(s"Unsupported enum case schema: ${c.schema}")) val nested = fromZSchemaMulti( c.schema, refType, ) - nested.children + (key -> nested.root) + nested.children ++ key.map(_ -> nested.root) } .toMap, )