Migrate remaining 7 ref endpoints to SX, add :returns type annotations
Add 14 new IO primitives to boundary.sx: web interop (request-form, request-json, request-header, request-content-type, request-args-all, request-form-all, request-headers-all, request-file-name), response manipulation (set-response-header, set-response-status), ephemeral state (state-get, state-set!), and timing (now, sleep). All 19 reference handlers now have :returns type annotations using types.sx vocabulary. Response meta (headers/status) flows through context vars, applied by register_route_handlers after execution. Only SSE endpoint remains in Python (async generator paradigm). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -226,10 +226,11 @@ def make_handler_def(name, params, body, env, opts=None):
|
||||
path = opts.get('path') if opts else None
|
||||
method = str(opts.get('method', 'get')) if opts else 'get'
|
||||
csrf = opts.get('csrf', True) if opts else True
|
||||
returns = str(opts.get('returns', 'element')) if opts else 'element'
|
||||
if isinstance(csrf, str):
|
||||
csrf = csrf.lower() not in ('false', 'nil', 'no')
|
||||
return HandlerDef(name=name, params=list(params), body=body, closure=dict(env),
|
||||
path=path, method=method.lower(), csrf=csrf)
|
||||
path=path, method=method.lower(), csrf=csrf, returns=returns)
|
||||
|
||||
|
||||
def make_query_def(name, params, doc, body, env):
|
||||
|
||||
Reference in New Issue
Block a user