Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input validation #3

Open
vermiculus opened this issue May 10, 2017 · 0 comments
Open

Input validation #3

vermiculus opened this issue May 10, 2017 · 0 comments

Comments

@vermiculus
Copy link
Owner

Need a way to pass functions that validate input (e.g., for required parameters) so errors don't propagate downstream.

Something like this would be ideal:

(defapipost-ghubp "/repos/:owner/:repo/pulls"
  "Open a pull request."
  "pulls/#create-a-pull-request"
  (repo) "/repos/:repo.owner.login/:repo.name/pulls"
  :validate-data
  (lambda (o)
    (--all? (let ((v (alist-get it o)))
              (and v (stringp v) (< 0 (length v))))
            '(title head base))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant