github Effect-TS/effect @effect/openapi-generator@4.1.6

one hour ago

Patch Changes

  • #10799 66ab992 Thanks @gcanti! - Generated client method comments now show the OpenAPI operation summary above the description, with identical text appearing only once.

  • #10921 60ae98e Thanks @CheckPickerUpper! - Generated HttpApi groups now drop the group prefix from endpoint names (balance.read becomes read) while keeping the qualified OpenAPI operation id, reject operations whose names collide within a group, and only emit the parameter schemas grouped endpoints use.

  • #10839 cf50541 Thanks @Marve10s! - Fix generated multipart/form-data payloads rejecting format: binary files in open object schemas while preserving undeclared form fields.

  • #10797 f90a026 Thanks @gcanti! - A response with no body can still have a description in the API documentation. For example, an OpenAPI file can describe a 404 as "Order not found". The generator used to copy the status code into the HttpApi and drop that text.

    // Before
    HttpApiSchema.Empty(404)
    
    // After
    HttpApiSchema.Empty(404).annotate({ description: "Order not found" })

    Exporting the generated HttpApi back to OpenAPI now produces the original "Order not found" description.

    A shared 404 with its own description

    In this OpenAPI 3.1 example, $ref points to a shared response whose description is "Resource not found". The line below it gives this particular 404 a more specific description.

    responses:
      "404":
        $ref: "#/components/responses/NotFound"
        description: Order not found

    The generator writes HttpApiSchema.Empty(404).annotate({ description: "Order not found" }). If you omit the description line, it uses "Resource not found" from the shared response.

    An explicit 500 and a fallback

    responses:
      "200":
        description: OK
      "500":
        description: Server error
      default:
        description: Other errors

    For this input, the generated endpoint has one error response, HttpApiSchema.Empty(500).annotate({ description: "Server error" }). The generator skips default and emits a warning because it would assign "Other errors" to the same status. If you remove the explicit 500 from this example, the generator uses default to produce a 500 described as "Other errors".

  • Updated dependencies [dd5f2f3, 1d65846, 694c28f, 5aaa2cd, 55814bf, 92c40a1, 9f415a7, e367afd, d5d2112, fa2e5af, 6bf6427, 10bc4a4, a9540d3, 3a250d7, ce44141, 9318e5b, c9ecebf, 32f8fbe, 41d6af1, c33fd59, 1f9e9d3, 594fa71, b378c38, a9ec9a6, 310a81b, 2576bbc, aab2135, 6744a72, 848d042, 077a93e, aef50fb, 2e4de86, 482b104, 753e1ed, 0d2bb4a, 8161e03, bb02f33, 49f5391, 3d59bdf, 8866608, 69fd4b1, 7d97626, 0e79436, 2f8a4e9, 800b753]:

    • effect@4.1.6
    • @effect/platform-node@4.1.6

Don't miss a new effect release

NewReleases is sending notifications on new releases.