ocsigen / eliom

Multi-tier framework for programming web and mobile applications in OCaml.
http://eliom.org
Other
300 stars 53 forks source link

Check for POST services without GET fallback at startup #357

Open darioteixeira opened 8 years ago

darioteixeira commented 8 years ago

Mind you, this is not a feature that I think is essential nor even important. It's just an idea for getting around the problem that Eliom6 does not enforce at the type system level that POST services must have a GET fallback.

Basically, the idea is to check at startup that all POST services have a GET service with the same path, and to issue a warning if a violation is found. Since the warning is not fatal, users who purposefully don't register GET fallbacks (RESTful use cases) will be happy. And since there is a warning, users who depend on Eliom's no-broken-links guarantees will also be happy.

Also, note that Eliom already relies on a runtime check for a similar situation: it checks at startup if all the declared services have in fact been registered.

vasilisp commented 8 years ago

I like the idea. Implementing this may be a bit of work (I am not sure we have clean-enough interfaces to query the routing data structures), but I will take a look.

darioteixeira commented 8 years ago

Yeah, consider it a low-priority feature that you may bump into higher priority if someone actually complains about Eliom6... :-)