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

Dynamic parameter names #76

Open
kevinresol opened this issue Feb 11, 2019 · 3 comments
Open

Dynamic parameter names #76

kevinresol opened this issue Feb 11, 2019 · 3 comments

Comments

@kevinresol
Copy link
Member

@:params(bar('bar-$_') in query)
function get(bar:DynamicAccess<String>);

and a request with ?bar-foo=a&bar-baz=b would be translated to {foo:'a', baz:'b'} in Haxe.

Any thoughts?

@back2dos
Copy link
Member

Well, the main problem here is parsing DynamicAccess, which is currently unsupported. It'll require restructuring how the data is stored in the parser, because getting maps from a flat key-value-list is not that easy. Especially if you consider more complex cases like DynamicAcces<String, { ?foo:String, ?bar:Int }>.

@kevinresol
Copy link
Member Author

Query string is only part of the problem. I also want this to work with request headers. (Thanks to aws)

@back2dos
Copy link
Member

Yeah, but headers are basically a key-value list too ... both get parsed via tink_querystring, which despite its name is not that query string specific ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants