From 49ca6435603069d8d301a7c14db4c036ccf111e6 Mon Sep 17 00:00:00 2001 From: Simon Schenk Date: Tue, 5 Dec 2023 10:19:32 +0100 Subject: [PATCH 1/2] fix: use @caseName annotations for openapi enums --- .../main/scala/zio/http/endpoint/openapi/JsonSchema.scala | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 c7b0b5b201..14917374f7 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 @@ -445,7 +445,11 @@ object JsonSchema { case enum0: Schema.Enum[_] if refType != SchemaStyle.Inline && nominal(enum0).isDefined => JsonSchema.RefSchema(nominal(enum0, refType).get) case enum0: Schema.Enum[_] if enum0.cases.forall(_.schema.isInstanceOf[CaseClass0[_]]) => - JsonSchema.Enum(enum0.cases.map(c => EnumValue.Str(c.id))) + JsonSchema.Enum( + enum0.cases.map(c => + EnumValue.Str(c.annotations.collectFirst { case caseName(name) => name }.getOrElse(c.id)), + ), + ) case enum0: Schema.Enum[_] => val noDiscriminator = enum0.annotations.exists(_.isInstanceOf[noDiscriminator]) val discriminatorName0 = From 0049f5d32398027c89aca8234e696dfe70e1cdf4 Mon Sep 17 00:00:00 2001 From: Simon Schenk Date: Fri, 8 Dec 2023 07:16:32 +0100 Subject: [PATCH 2/2] generateReadme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cd884f1d60..1727665fb9 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ ZIO HTTP is a scala library for building http apps. It is powered by ZIO and [Ne Setup via `build.sbt`: ```scala -libraryDependencies += "dev.zio" %% "zio-http" % "3.0.0-RC3" +libraryDependencies += "dev.zio" %% "zio-http" % "3.0.0-RC4" ``` **NOTES ON VERSIONING:**