requestBody.content.multipart/form-data.schema.properties.<file>.contentEncoding (and contentMediaType) is not valid OS3.0
Those two fields (contentEncoding and contentMediaType) are not in the OS 3.0 spec, though they are in the OS 3.1 spec.
Our generator only supports 3.0, so it fails there. I will investigate what a fix would take.
Content encoding is added here https://github.com/danielgtaylor/huma/blob/main/formdata.go#L241
contentMediaType is added here https://github.com/danielgtaylor/huma/blob/c7a8a7965d84e4aded17671da32bea8c69e4201e/schema.go#L168
I see there's downgrade code already
https://github.com/danielgtaylor/huma/blob/c7a8a7965d84e4aded17671da32bea8c69e4201e/openapi.go#L1624-L1639
Here's our schema
requestBody:
content:
multipart/form-data:
encoding:
Data:
contentType: text/plain
file:
contentType: text/plain
schema:
properties:
Data:
$ref: "#/components/schemas/CertificateImportData"
file:
contentEncoding: binary
contentMediaType: application/octet-stream
format: binary
type: string
required:
- file
type: object
Ok this is indeed not 3.0.3 valid, and it's under the SchemaObject specification:
https://spec.openapis.org/oas/v3.0.3#schema-object
In general (not just for requestBody or for multipart encoding), those 2 properties are not allowed in OS 3.0.3
I would propose something like https://github.com/danielgtaylor/huma/pull/919