Skip to content

Decorators are lost when module is mounted #31

@enikesha

Description

@enikesha

Decorators defined on define-route are lost when this module is mounted as sub-module into other module.

My simplified situation is like this:

packages.lisp

(restas:define-module #:test
  (:use #:cl))

(restas:define-module #:test.admin
  (:use #:cl))

admin.lisp

(in-package #:test.admin)

(defclass login-required-route (routes:proxy-route) ())
(defmethod restas:process-route ((route login-required-route) bindings)
  (break)) ;; Not breaking
(defun @login-required (route)
  (make-instance 'login-required-route :target route))

(restas:define-route admin-index ("")
  (:decorators '@login-required)
  "In admin")

test.lisp

(in-package #:test)

(restas:mount-module admin (#:test.admin)
  (:url "admin"))

Going to /admin/ is not actually breaking in this case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions