Skip to content

Add shared options to @route that would exclude this route from duplicate verb+path validation #1133

Description

@timotheeguerin

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)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions