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

AbstractReviver should be able to auto-select the root node #2

Open
Rebolon opened this issue Apr 9, 2018 · 0 comments
Open

AbstractReviver should be able to auto-select the root node #2

Rebolon opened this issue Apr 9, 2018 · 0 comments

Comments

@Rebolon
Copy link
Owner

Rebolon commented Apr 9, 2018

For instance here is what we have to do:

const oneBook = {
    "book": {
        "title": "Zombies in western culture",
        "serie": {
            "name": "Open Reports Series"
        }
    }
}

const serieReviver = new SerieReviver()
const bookReviver = new BookReviver(serieReviver)

const book = bookReviver.main(oneBook.book)

to get a Book we have to send oneBook.book instead of oneBook.
Maybe we should change the AbstractReviver::main to allow to get automatically the root node:

  • IF the propertyPath is on the root AND this.getNodeName is found in the content HEN take it and send to initFromJon
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

1 participant