Skip to content

Generated openAPI documentation doesn't use examples of response objects #3259

@jiramares

Description

@jiramares

Describe the bug
In following endpoint specification I provide response object example:

val ep2 = Endpoint(RoutePattern.GET / "greeting" / string("name"))
    .outCodec(HttpCodec.content[Greeting].example("1", Greeting("Hi Jane")) ?? Doc.p("Response"))

but the generated openAPI show response as:

{
  "msg": "string"
}

Expected behaviour
The response example should be

{
  "msg": "Hi Jane"
}

Dependencies:

    "dev.zio" %% "zio" % "2.1.9",
    "dev.zio" %% "zio-http" % "3.0.1"
    "dev.zio" %% "zio-schema" % "1.4.1"

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions