zio / zio-http

A next-generation Scala framework for building scalable, correct, and efficient HTTP clients and servers
https://zio.dev/zio-http
Apache License 2.0
802 stars 406 forks source link

[Regression from `v3.0.1`][OpenAPI doc generation] In the latest build of the `main` branch, `v3.0.1+26-dc1f3f41-SNAPSHOT`, the generated OpenAPI doc doesn't include the endpoint documentation anymore #3198

Open jivanic-demystdata opened 3 weeks ago

jivanic-demystdata commented 3 weeks ago

I tried to update to the latest build to see if it'd fix an issue we have. When I regenerated my TypeScript SDK from the generated OpenAPI documentation, all the documentation in the TS SDK is disappearing.

For the following endpoint:

  val `POST /source-templates`
    : Endpoint[Unit, SourceTemplateInput, CreateSourceTemplateError, SourceTemplateEntityOutput, AuthType.Bearer] =
    (Endpoint(RoutePattern.POST / "source-templates") ?? Doc.p("Create a Source Template"))
      .outErrors[CreateSourceTemplateError](
        HttpCodec.error[CreateSourceTemplateError.InternalServerError](zio.http.Status.InternalServerError) ?? Doc.p("Not Found"),
        HttpCodec.error[CreateSourceTemplateError.OtherError](zio.http.Status.InternalServerError) ?? Doc.p("Other error"),
      )
      .in[SourceTemplateInput](mediaType = MediaType.application.json, doc = Doc.p("The Source Template to create"))
      .out[SourceTemplateEntityOutput](mediaType = MediaType.application.json, doc = Doc.p("The created Source Template"))
      .auth(AuthType.Bearer)

With v3.0.1, the OpenAPI doc does correctly include the "Create a Source Template" documentation:

image

While with the latest build from the main, v3.0.1+26-dc1f3f41-SNAPSHOT, it disappears:

image

This result in the following change in my generated TS SDK:

image

The regression might come from these changes: https://github.com/zio/zio-http/pull/3147

jdegoes commented 2 weeks ago

/bounty $75 for fix and regression test

algora-pbc[bot] commented 2 weeks ago

💎 $75 bounty • ZIO

Steps to solve:

  1. Start working: Comment /attempt #3198 with your implementation plan
  2. Submit work: Create a pull request including /claim #3198 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

Thank you for contributing to zio/zio-http!

Add a bountyShare on socials

Attempt Started (GMT+0) Solution
🟢 @mobley-trent Nov 26, 2024, 10:20:20 AM #3221
mobley-trent commented 3 days ago

/attempt #3198

Algora profile Completed bounties Tech Active attempts Options
@mobley-trent    1 ZIO bounty
+ 10 bounties from 4 projects
Python, Rust,
Go & more
Cancel attempt
algora-pbc[bot] commented 3 days ago

💡 @mobley-trent submitted a pull request that claims the bounty. You can visit your bounty board to reward.