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
{{ message }}
Repository navigation
API validation is bypassed if content-type header is missing #100
but there are no signs of this invocation anywhere in the UI/CLI.
These are also confusing, here we are rejected due to a validation error (we include content-type)
curl --request POST --url 'http://restate:8080/Vins/notify_missing_suggested_vin/send' \
--header 'idempotency-key: 5' \
--header 'Content-Type: application/json'
{"message":"input validation error: Empty body not allowed"}
while here we are allowed through (without sending content-type):
curl --request POST --url 'http://restate:8080/Vins/notify_missing_suggested_vin/send' \
--header 'idempotency-key: 6'
{"invocationId":"inv_16HxFwmpUywS6u2dDPl5Mso8x6SdiNPIr4","status":"Accepted"}
Success cases
Requests to direct invocations work
curl --request POST --url 'http://restate:8080/Vins/notify_missing_suggested_vin' --header 'Content-Type: application/json' --data '{"make":"hola","model":"mundo","year":1234}'
{"message":"Notified make hola model mundo year 1234 missing!"}
This one should indeed not happen, because missing the content type application json when the expected payload is json is wrong. cc @igalshilman
Requests with incomplete data (missing year in this case)
curl --request POST --url 'http://restate:8080/Vins/notify_missing_suggested_vin/send'
--header 'Content-Type: application/json'
--data '{"make":"hola","model":"mundo"}'
{"invocationId":"inv_1eDPloDKJ9ho6wP12kDcy4J4Wj7EdqLIlP","status":"Accepted"}
but there are no signs of this invocation anywhere in the UI/CLI.
Be aware that the "schema" validation happens in the SDK at the moment, and not in restate-server. Restate will only check the content type, and whether the body is empty or not, the rest of the validation happens in the SDK.
What probably happened here is that the invocation was rejected in the SDK, and after that is not retained. If you send the request with idempotency key, you'll see the failed result persisted after completion.
Activity
avilaton commentedon May 29, 2025
More weird/incorrect cases
Requests with incomplete data (missing year in this case)
but there are no signs of this invocation anywhere in the UI/CLI.
These are also confusing, here we are rejected due to a validation error (we include content-type)
while here we are allowed through (without sending content-type):
Success cases
Requests to direct invocations work
as do requests to /send
slinkydeveloper commentedon May 30, 2025
Will check this out. In the meantime which sdk are you using?
avilaton commentedon May 30, 2025
Thanks! We are using the python SDK with the latest release of everything.
slinkydeveloper commentedon Jun 2, 2025
Let me answer one by one on the cases here:
This is correct, empty body is not a valid json
This one should indeed not happen, because missing the content type application json when the expected payload is json is wrong. cc @igalshilman
Be aware that the "schema" validation happens in the SDK at the moment, and not in restate-server. Restate will only check the content type, and whether the body is empty or not, the rest of the validation happens in the SDK.
What probably happened here is that the invocation was rejected in the SDK, and after that is not retained. If you send the request with idempotency key, you'll see the failed result persisted after completion.