When ephemeral field is within the body of the POST request to /relay/v1/auto/messages field, the REST API can't deserialize the body.
Impact
Mid
To reproduce
Run a Waku node.
Subscribe to /test/0/ephemeral/proto for this test.
Send a POST request without ephemeral to confirm it is working:
curl -X POST "http://127.0.0.1:8645/relay/v1/auto/messages" \
-H "content-type: application/json" \
-d '{"payload":"ZXhhbXBsZQ==","contentTopic":"/test/0/ephemeral/proto","version":0,"timestamp":1714373499732887000}'
# OK
Send a POST request with ephemeral to confirm it is failing.
curl -X POST "http://127.0.0.1:8645/relay/v1/auto/messages" \
-H "content-type: application/json" \
-d '{"payload":"ZXhhbXBsZQ==","contentTopic":"/test/0/ephemeral/proto","version":0,"timestamp":1714373499732887000,"ephemeral":false}'
# Invalid content body, could not decode. Unable to deserialize data
2024-04-29 10:06:23 DBG 2024-04-29 07:06:23.357+00:00 Serving API request tid=1 file=serverprivate.nim:202 peer=172.18.0.1:65108 meth=POST uri=/relay/v1/auto/messages path_params=[] query_params=[] content_body="(application/json, 129 bytes)"
2024-04-29 10:06:23 DBG 2024-04-29 07:06:23.358+00:00 JSON field not recognized by the current version of nwaku. Consider upgrading tid=1 file=types.nim:102 fieldName=ephemeral typeName=None
2024-04-29 10:06:23 DBG 2024-04-29 07:06:23.360+00:00 Received error response from handler tid=1 file=serverprivate.nim:314 status=400 meth=POST peer=172.18.0.1:65108 uri=/relay/v1/auto/messages error_status="400 Bad Request" error_content_type=text/plain error_message="Invalid content body, could not decode. Unable to deserialize data"
nwaku version/commit hash
Docker image from http://harbor.status.im/wakuorg/nwaku:v0.26.0
Problem
When
ephemeral
field is within the body of the POST request to/relay/v1/auto/messages
field, the REST API can't deserialize the body.Impact
Mid
To reproduce
/test/0/ephemeral/proto
for this test.ephemeral
to confirm it is working:ephemeral
to confirm it is failing.Expected behavior
Should be able to deserialize as per the REST API documentation at https://waku-org.github.io/waku-rest-api/#post-/relay/v1/auto/messages
Screenshots/logs
Here is the log from failing request:
nwaku version/commit hash
Docker image from
http://harbor.status.im/wakuorg/nwaku:v0.26.0
Additional context
None