joaotavora / snooze

Common Lisp RESTful web development
207 stars 22 forks source link

Case sensitive path #30

Closed n00p3 closed 3 years ago

n00p3 commented 3 years ago

Consider following snippet:

(defroute test (:get :text/* path) (format nil "~a" (type-of path)))

When I request localhost:9004/test/123, then path is an integer, but if I request localhost:9004/test/abc, then path is a symbol. Is it possible to get string/pipe delimited symbol instead of just regular symbol? I need to have preserved information about character case.

joaotavora commented 3 years ago

Maybe this helps: https://github.com/joaotavora/snooze#how-snooze-converts-uri-components-to-arguments

n00p3 commented 3 years ago

Ok, solved it by adding

(defmethod snooze:read-for-resource ((resource (eql #'test)) string)
       string)
joaotavora commented 3 years ago

If you want to do that, you should also probably write a snooze:write-for-resource so that you can use the defgenpath helper and generate URLs for you routes.