You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pull request #527, released in version v2.20.0, introduced a backwards-incompatible change to the way that Huma generates OpenAPI schemas.
Previously, arrays were recorded as an OpenAPI array type, but now they are recorded as either array or null. This change was pushed out in a minor version update, which the go tool will often quietly upgrade to. By upgrading to this version, any application using Huma has subtly made a breaking change to its API schema.
Adding additional types to the schema means that clients generated from the schema now have to add logic to deal with both possibilities. I know that Go can serialise arrays as null, but our application is written in a way such that this is not possible.
Update: I have found that the OpenAPI 3.0 (as opposed to 3.1) schema is not affected by this change, so oapi-codegen users should use the openapi-3.0.json schema. Closing for now.
Pull request #527, released in version
v2.20.0
, introduced a backwards-incompatible change to the way that Huma generates OpenAPI schemas.Previously, arrays were recorded as an OpenAPI
array
type, but now they are recorded as eitherarray
ornull
. This change was pushed out in a minor version update, which thego
tool will often quietly upgrade to. By upgrading to this version, any application using Huma has subtly made a breaking change to its API schema.Adding additional types to the schema means that clients generated from the schema now have to add logic to deal with both possibilities. I know that Go can serialise arrays as null, but our application is written in a way such that this is not possible.
This also totally breaks oapi-codegen:
There are multiple other people reporting this issue on the original PR thread.
Please make the change to how schemas are generated a configurable option.
The text was updated successfully, but these errors were encountered: