RESTAS:DEFINE-ROUTE no longer takes :PARSE-VARS #18

Open
phmarek opened this Issue Mar 11, 2013 · 2 comments

Comments

Projects
None yet
3 participants
@phmarek

phmarek commented Mar 11, 2013

What's the new way to do that now?
Thanks for any help.

Regards,
Ph.

@archimag

This comment has been minimized.

Show comment Hide comment
@archimag

archimag Mar 11, 2013

Owner

Using :sift-variables declaration instead.

Samples:

(restas:define-route topic ("thread/:topic-id")
  (:sift-variables (topic-id #'parser-integer))
  ...)

or

(restas:define-route myroute (":val1/:val2")
  (:sift-variables
   (val1 'integer :min-value 1 :max-value 100)
   (val2 'data-sfit:email :message "Doesn't look like a valid email."))
  ..)

See https://github.com/archimag/data-sift/blob/master/src/sift.lisp for detail. The current documentation is outdated.

Owner

archimag commented Mar 11, 2013

Using :sift-variables declaration instead.

Samples:

(restas:define-route topic ("thread/:topic-id")
  (:sift-variables (topic-id #'parser-integer))
  ...)

or

(restas:define-route myroute (":val1/:val2")
  (:sift-variables
   (val1 'integer :min-value 1 :max-value 100)
   (val2 'data-sfit:email :message "Doesn't look like a valid email."))
  ..)

See https://github.com/archimag/data-sift/blob/master/src/sift.lisp for detail. The current documentation is outdated.

@egarrulo

This comment has been minimized.

Show comment Hide comment
@egarrulo

egarrulo Jun 1, 2014

Thanks, but I can't make it work.

(define-route hello ("")
                (format nil "Hello ~a, aged ~a!" "Liz" 40))

works, whilst:

(define-route hello (":name/:age")
               (:sift-variables (name 'string) (age 'integer))
               (format nil "Hello ~a, aged ~a!" name age))

does not work. I have tried "(restas:debug-mode-on)", but no messages are printed..

Any suggestion? I am using the latest RESTAS and DATA-SIFT, as downloaded by Quicklisp.

Thanks for your attention.

egarrulo commented Jun 1, 2014

Thanks, but I can't make it work.

(define-route hello ("")
                (format nil "Hello ~a, aged ~a!" "Liz" 40))

works, whilst:

(define-route hello (":name/:age")
               (:sift-variables (name 'string) (age 'integer))
               (format nil "Hello ~a, aged ~a!" name age))

does not work. I have tried "(restas:debug-mode-on)", but no messages are printed..

Any suggestion? I am using the latest RESTAS and DATA-SIFT, as downloaded by Quicklisp.

Thanks for your attention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment