:parse-vars error

21 views
Skip to first unread message

Mike McCarty

unread,
Apr 25, 2013, 9:41:50 AM4/25/13
to res...@googlegroups.com
I'm updating our application code to work with the latest restas.  With the new function signature of define-route I'm moving route traits to the body.  My question is do I also need to do this with :parse-vars.  I'm getting the following compilation error.

; caught ERROR:
;   (during macroexpansion of (RESTAS:DEFINE-ROUTE SHOW-ACCOUNT-INVOICE
;       ...))
;   Unknown type of declaration: PARSE-VARS

; in: RESTAS:DEFINE-ROUTE DELETE-INVOICE
;     (RESTAS:DEFINE-ROUTE ADMIN::DELETE-INVOICE
;         ("/accounts/:account/invoices/:invoice" :METHOD :DELETE)
;       (:PARSE-VARS
;        (LIST :ACCOUNT #'ADMIN::FIND-ACCOUNT :INVOICE #'ADMIN::FIND-INVOICE))
;       blah blah blah

I've noticed that I don't get an error if I set :decorators or :requirements to nil before setting :parse-vars.

Thanks,
-mike

Andrey Moskvitin

unread,
Apr 25, 2013, 10:04:16 AM4/25/13
to res...@googlegroups.com
Hi,

You must use :sift-variables declaration:

(restas:define-route show-account-invoice ("/accounts/:account/invoices/:invoice" :method :delete)
  (:sift-variables (account #'admin::find-account)  (invoice #'admin::find-invoice))
  ...)

Andrey


2013/4/25 Mike McCarty <mike.m...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "restas" group.
To unsubscribe from this group and stop receiving emails from it, send an email to restas+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Mike McCarty

unread,
Apr 25, 2013, 10:33:55 AM4/25/13
to res...@googlegroups.com
Ah, perfect.  Thank you!
Reply all
Reply to author
Forward
0 new messages