Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Required Body [dataFile] not specified #11298

Open
chandankumarjena opened this issue Nov 1, 2024 · 2 comments
Open

Required Body [dataFile] not specified #11298

chandankumarjena opened this issue Nov 1, 2024 · 2 comments

Comments

@chandankumarjena
Copy link

chandankumarjena commented Nov 1, 2024

Expected Behavior

my code is like

@Post(value = "/", consumes = {MediaType.IMAGE_PNG, MediaType.TEXT_XML, MediaType.MULTIPART_FORM_DATA})
    public HttpResponse<ConfirmMessage> createFile(@Body byte[] dataFile, @Header("documentId") String documentId, @Header("Content-Type") String contentType, HttpRequest<?> request) {
//
}

I have recently migrate to micronaut 4 and jdk17. Earlier the same code was working fine but it is giving the below error now.

{
"message": "Bad Request",
"_embedded": {
"errors": [

{ "message": "Required Body [dataFile] not specified", "path": "/dataFile" }
]
},
"_links": {
"self":
{ "href": "/xyx", "templated": false }
}
}

Need help here

Actual Behaviour

{
"message": "Bad Request",
"_embedded": {
"errors": [

{ "message": "Required Body [dataFile] not specified", "path": "/dataFile" }
]
},
"_links": {
"self":
{ "href": "/xyz", "templated": false }
}
}

Steps To Reproduce

No response

Environment Information

micronaut -4
jdk 17

Example Application

No response

Version

micronaut 4, jdk 17

@yawkat
Copy link
Member

yawkat commented Nov 5, 2024

is the body empty in the request youre testing?

@chandankumarjena
Copy link
Author

chandankumarjena commented Nov 6, 2024

I am uploading an Encrypt.xml file with some record.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants