-
Notifications
You must be signed in to change notification settings - Fork 64
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
Support tokenized JSON Reference URIs #54
Comments
I could probably just get this done in |
Totally up to you... Your description looks good, though if you are implementing, I'm wondering whether your "post-process" idea involve altering the meta-data so the resolutions can immediately resume (as though the JSON reference had been well-formed in the first place). I guess I'm hoping for a "mid-process" capability to avoid repeating traversal of the JSON if that would be doable. But again, no need from my perspective to make it into this release. |
The idea of pre-processing is to do token replacement and such while post-processing might be some sort of failure recovery thing. As for "mid-process"...I'm not sure what you mean. We only process the document once every, even if you call APIs more than once. :) |
I just mean to avoid needing to both find all of the references once to do the variable substitution, and then searching the document again to find the fixed references to do the resolving. |
I think with pre-processing and/or post-processing, you could do it at one time. |
Well, the way I see implementing it. |
Ok, cool |
Let me know what you think. Here is the gist of it:
Neither of these functions modify the provided document. Feel free to look at the API documentation and tests to see how it works. |
Looks perfect, thanks very much! |
Do you have any time to play with the new APIs/options to give them a sanity check? Even if you just look over the API documentation that would be a huge help. If not, no biggie. I'll release tomorrow. |
Yeah, I looked over the docs, tests, and new code and it looks great from what I can see. (I also ran the tests which are working on my machine too.) Just don't forget the |
Imagine your JSON document has i18n tokens in its JSON Reference URIs. It would be nice to be able to either pre-process a JSON Reference prior to generating its metadata via
#getRefDetails
/#findRefs
and/or post-process the JSON Reference metadata after the fact to alter the metadata. While i18n is one example, any situation where you have dynamic URIs could benefit from this./cc @brettz9
The text was updated successfully, but these errors were encountered: