nswbmw / koa-scheme

koa-scheme is a parameter validation middleware for koa.
46 stars 2 forks source link

Example of differing method schemas #2

Closed ndarilek closed 9 years ago

ndarilek commented 10 years ago

This looks like exactly what I'm looking for, and I've got it quickly up and running validating incoming requests.

I'm uncertain about something, though. Say I have an /api/session endpoint. POSTing should require login/password parameters, but DELETE requires none and logs out. How do I model this? It looks like API endpoints are keyed first on path, then on request/response. Seems like it'd make sense to key on path, then method, then request/response. But perhaps I'm missing something.

yorkie commented 10 years ago

We should support requests that mapping the different METHOD.

nswbmw commented 9 years ago

@ndarilek @yorkie koa-scheme v1.0.0 released, it has some fancy features. checkout~

yorkie commented 9 years ago

neat!! :cherries: