haxetink / tink_web

Tinkerbell Web Framework
https://haxetink.github.io/tink_web
43 stars 14 forks source link

Revamp #86

Closed kevinresol closed 5 years ago

kevinresol commented 5 years ago

Trying to cleanup the codebase to support #75. Old tests passes. Plus one new test case for #75 passing...

A few things missing:

Now I need to rest for a few days.

kevinresol commented 5 years ago

Since args/params/paths are tightly correlated we can't really split them completely.

So I decided to parse each route in the following order:

  1. parse @:params into Parameters, with some prelim test against the raw arg list
  2. parse @:<method> into Paths, with some prelim test against the raw arg list (but not yet implemented)
  3. Use params and paths to create Arguments, which is a "rich" arg list containing all useful information.
kevinresol commented 5 years ago

I didn't (can't?) port the path deviation object because I am not sure what it is doing. @back2dos can you add a few test cases to illustrate it?

kevinresol commented 5 years ago

I removed the toCamelCase transform (which is a breaking change) because we can now specify the exact header name by @:params(foo = header['x-tink-web'])

kevinresol commented 5 years ago

I removed the toCamelCase transform (which is a breaking change) because we can now specify the exact header name by @:params(foo = header['x-tink-web'])

and

function get(headers:{
  @:name('x-bar') var bar:String;
});