Skip to content

API validation is bypassed if content-type header is missing #100

@avilaton

Description

@avilaton

Hi everyone, I think we have found a bug in restates's API validation.

Given a service with 3 mandatory arguments make(str),year(str),model (int), we found that this request

curl --request POST \
  --url 'http://restate:8080/Vins/notify_missing_suggested_vin/send' \
  --header 'Content-Type: application/json'

fails with 400 status error and this message

{"message":"input validation error: Empty body not allowed"}

while this

curl --request POST \
  --url 'http://restate:8080/Vins/notify_missing_suggested_vin/send'

succeeds, and creates an invocation with broken parameters

{"invocationId":"inv_1faXAMNrjkWq46yXz5nAKyjfuVEOa2rI7n","executionTime":"2025-05-29T02:20:35.027000000Z","status":"Accepted"}

which results in a never ending failing invocation since those empty parameters were actually expected.

Please let me know if you think we made a mistake filing this. Thanks for creating restate it is awesome.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions