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

Expand nested objects #22

Open
heruan opened this issue Aug 10, 2016 · 1 comment
Open

Expand nested objects #22

heruan opened this issue Aug 10, 2016 · 1 comment

Comments

@heruan
Copy link

heruan commented Aug 10, 2016

Is it possible to do something like this?

const params = {
    user: {
        id: 123
    }
};

template("/users/{user.id}").fill(params); // => "/users/123"
@nichtich
Copy link

The specification says:

Structures are processed as if they are an associative array
with names corresponding to the fields in the structure definition
and "." separators used to indicate name hierarchy in substructures

So your example must be expanded to "/users/123"

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