From design #984
Be explicit when to bypass this error @route takes a new parameter shared, defaulting to false that would bypass verb+route validation.
@route("/uploadImage", { shared: true })
op uploadImageBytes(@body body: bytes, @header contentType: "image/png"): void
@route("/uploadImage", { shared: true })
op uploadImageJson(@body body: {imageBase64: bytes}, @header contentType: "application/json"): void
// error: not shared route
@route("/uploadImage")
op uploadImageJson(@body body: {imageBase64: bytes}, @header contentType: "application/json"): void
- All routes under the same route MUST have the shared param
Resulting python
def upload_image_bytes(body: stream):
request("/uploadImage", body)
def upload_image_json(body: object):
request("/uploadImage", body)
From design #984
Be explicit when to bypass this error
@routetakes a new parametershared, defaulting tofalsethat would bypassverb+routevalidation.Resulting python