Skip to content

Commit

Permalink
Test with patch changes
Browse files Browse the repository at this point in the history
  • Loading branch information
asr2003 authored Aug 2, 2024
1 parent 5b53c24 commit cfedb5e
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import zio.http._
import zio.http.codec.PathCodec.string
import zio.http.codec.{ContentCodec, Doc, HttpCodec, QueryCodec}
import zio.http.endpoint._
import zio.http.endpoint.openapi.JsonSchema
import zio.http.endpoint.openapi.JsonSchema.SchemaStyle

object OpenAPIGenSpec extends ZIOSpecDefault {

Expand Down Expand Up @@ -2458,6 +2460,16 @@ object OpenAPIGenSpec extends ZIOSpecDefault {
SwaggerUI.routes("docs/openapi", OpenAPIGen.fromEndpoints(endpoint))
assertCompletes
},
test("Ensure OpenAPI generation succeeds for Map[String, List[String]]") {
val schema = Schema.map[String, List[String]]
val openAPISchema = JsonSchema.fromZSchemaMulti(schema, SchemaStyle.Reference)
assertTrue(openAPISchema != null)
},
test("Failing test case for Map[String, List[String]] schema generation") {
val schema = Schema.map[String, List[String]]
val result = scala.util.Try(JsonSchema.fromZSchemaMulti(schema, SchemaStyle.Reference))
assertTrue(result.isFailure)
},
test("Recursive schema") {
val endpoint = Endpoint(RoutePattern.POST / "folder")
.out[Recursive]
Expand Down

0 comments on commit cfedb5e

Please sign in to comment.