Skip to content

Release v1.58.1 — Thuban: OpenAPI response-schema fidelity

Choose a tag to compare

@MichaelSowah MichaelSowah released this 15 Jun 20:20
65122fe

Theme: OpenAPI response-schema fidelity. Three additive generator fixes so reflected ResponseData DTOs document response bodies accurately: the success envelope marks success/message/data required, and #[ArrayOf] resolves array items in response mode (previously request-mode only). #[ArrayOf] is relaxed to target any class so response DTO item types need not implement RequestData; the request-DTO element constraint moves into the hydrator (fails loud, behavior unchanged). Patch release; no migrations, no config/env changes.

Fixed

  • OpenAPI: success envelope marks success/message/data as required. The single-object success envelope now matches the flat-pagination envelope, which already marked them. Additive; those keys are always present at runtime.
  • OpenAPI: #[ArrayOf] is honored in response mode. ClassSchemaReflector now resolves array items from #[ArrayOf] for ResponseData DTOs too (previously request-mode only), falling back to the @var Foo[] docblock. #[ArrayOf] is now the consistent array element-type source for both request and response DTOs. ArrayOf itself is relaxed to accept any existing class (not just RequestData implementations), so response DTO item types can be decorated without implementing RequestData.
  • Hydrator: #[ArrayOf] on a request DTO still requires a RequestData element class — now enforced in the hydrator (the constraint moved off #[ArrayOf] so response DTOs can use it). Fails loud (LogicException), consistent with the other v2 hydrator structural-misuse guards (dual-source, nested-source-attribute).