-
Notifications
You must be signed in to change notification settings - Fork 23
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
Suggestion: Generate Param values given a JSON #42
Comments
Interesting idea! It might be possible. I would welcome a PR if you'd like to attempt a solution. Do you have any initial thoughts on how a solution might be implemented? It reminds me of this JSON diff library I've worked with https://github.com/kbadk/json0-ot-diff |
Thanks @curran for your response. I am doing something like this.
|
or if you already have the template
|
Awesome! Happy to accept a PR if you add tests and docs. |
Hello @curran : While I did send you PR, I realise that it has a limitation. In the above method, I am assuming that the context object (the input json) key is the same name as the parameter. I did not account for cases where that may not be true. In which case, the PR sent will fail. Obviously, this is an after thought and hence I do not have any test case that checks for this too. I will think up of some other compare logic to determine locating the param in the context object |
I came across this library while searching for just this functionality. Thanks for sharing it.
I was wondering whether it would be possible to kind of reverse engineer and determine the parameter values given a resultant json.
Let me give an example to clarify what I am seeking:
Suppose the template is defined as
And passing a foo value generates the json
But is there a way to get the params given the resultant json. I am using a function called
extract
as an example to explain what will be usefulThanks
The text was updated successfully, but these errors were encountered: