Closed mistermoe closed 1 month ago
i'm thinking something like this?
// POST /exchanges
{
"message": { ... }, // the RFQ message
"replyTo": "example.com/reply"
}
// PUT /exchanges/:id
{
"message": { ... } // the Order or Close message
}
not sure if this was what you were thinking of, but i like having message
as top level field for all http requests for consistency, and the POST /exchanges/:id
happens to have an optional replyTo
top level field
Context
currently, the request body for "creating an exchange" (aka submitting an RFQ) looks like the following:
and submitting a message to an exchange looks like this:
Proposal
Proposing that we change the request body structure of
PUT /exchanges/:id
to be more symmetric to rfq submission. Concretely,the way it currently is prevents us from introducing any additional fields down the line because we've effectively polluted the "root" namespace of the request body with message contents. the request body is the message