-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
The operation in the generated OpenAPI for an endpoint that accepts a "binary" FromForm parameter (e.g. byte[]
) has a requestBody that includes an encoding
field with incorrect contents. The encoding field is generated as:
"encoding": {
"multipart/form-data": {
"style": "form",
"explode": true
}
}
But the OpenAPI specifcation says that encoding
is:
A map between a property name and its encoding information. The key, being the property name, MUST exist in the schema as a property.
The encoding
object shown above is incorrect because "multipart/form-data" is not a property name in the associated schema.
Expected Behavior
I'm not really sure what information this encoding
is intended to convey. It might be possible to simply delete it. But if it is important for some reason then the key must be a property name in the schema.
Steps To Reproduce
This branch https://github.com/mikekistler/aspnet-openapi-examples/tree/bug-57082 contains a recreate for this problem in the FormBodiesApi.cs file.
Exceptions (if any)
No response
.NET Version
9.0.100-rc.1.24380.1
Anything else?
No response