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
When I enter the above string in the title field of the generated Swashbuckle UI I'm getting error 400:
{
"type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"errors": {
"title": [
"The title field is required."
]
},
"traceId": "00-259db306db8ce9b0015192084dfc72f2-cd711e4da768cce5-00"
}
The code of my endpoint method is not hit. The error is produced by the framework. When I send the same request with Postman it works fine!
This only happens if the JSON string is well formed and not escaped.
This is sent correctly: {\"de\":\"Bildschirmfoto\",\"en\":\"screen shot\"}
As soon as the JSON is correctly formed, but not escaped the string is not passed and treated as not entered.
Since it works fine with Postman t must be a bug in Swashbuckle.,
Expected behavior
Pass the entered string into the variable.
Actual behavior
A string in valid JSON format is treated as not provided:
{
"type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"errors": {
"title": [
"The title field is required."
]
},
"traceId": "00-259db306db8ce9b0015192084dfc72f2-cd711e4da768cce5-00"
}
Steps to reproduce
No response
Exception(s) (if any)
No response
Swashbuckle.AspNetCore version
6.7.0
.NET Version
8.0.303
Anything else?
The text was updated successfully, but these errors were encountered:
Can you share your OpenAPI document and/or a runnable code sample in the form of a GitHub repo?
This could be either an issue with Swashbuckle (the OpenAPI document being incorrectly generated) or SwaggerUI (incorrectly interpreting the OpenAPI document).
Describe the bug
For an endpoint that accepts a file, the title, and a description in multiple languages I use this method
public async Task<ActionResult<GuidIdResponse>> UploadImage([FromForm] string title, [FromForm] string? description, IFormFile file)
The title is entered in JSON format like:
{de":"Bildschirmfoto","en":"screen shot"}
When I enter the above string in the title field of the generated Swashbuckle UI I'm getting error 400:
The code of my endpoint method is not hit. The error is produced by the framework. When I send the same request with Postman it works fine!
This only happens if the JSON string is well formed and not escaped.
This is sent correctly:
{\"de\":\"Bildschirmfoto\",\"en\":\"screen shot\"}
Those also pass through:
As soon as the JSON is correctly formed, but not escaped the string is not passed and treated as not entered.
Since it works fine with Postman t must be a bug in Swashbuckle.,
Expected behavior
Pass the entered string into the variable.
Actual behavior
A string in valid JSON format is treated as not provided:
{
"type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"errors": {
"title": [
"The title field is required."
]
},
"traceId": "00-259db306db8ce9b0015192084dfc72f2-cd711e4da768cce5-00"
}
Steps to reproduce
No response
Exception(s) (if any)
No response
Swashbuckle.AspNetCore version
6.7.0
.NET Version
8.0.303
Anything else?
The text was updated successfully, but these errors were encountered: