<div dir="auto">TL;DR</div><div dir="auto"><br></div><div dir="auto">It makes more sense if the JSON is invalid.  If the JSON is invalid, one is given the choice of cancel vs ok.   If you click ok, then it takes you to the alert you see when the document is valid.   The idea behind this shows up in the main idea behind the main X3DJSONLD app—if the user discovers some invalid JSON, they may want to either cancel—stop loading, or click ok—continue to rendering and event processing.</div><div dir="auto"><br></div><div dir="auto">I would like to change the validation software to change the HTML page based on what the results are, for better automated processing;  but right now, it’s more user-centered.  Obviously the invalid alert is too small, and something on the web page would be more readable and processable.</div><div dir="auto"><br></div><div dir="auto">You can easily change the JSON on the page to test scenarios.</div><div dir="auto"><br></div><div dir="auto">I think the doValidate function variable may not currently be set properly.   It may need work, but simple tests seem to work right now.</div><div dir="auto"><br></div><div dir="auto">I hope this helps.</div><div dir="auto"><br></div><div dir="auto">I hope to continue the approach where the user  is not required to submit anything to the back end server—everything is done in the browser.   I don’t want to be accused of storing information about the user.   I think it may be understood that web page accesses are stored in access logs; no surprise there, I hope.</div><div dir="auto"><br></div><div dir="auto">I am wondering if I should continue this URL-JSON submittal into the main X3DJSONLD app.   I’m a bit worried about cross-site request forgery, cross-site scripting, etc.   Thus I have left all security settings on.   I have not set more restrictive settings.   If the user wants to set a different CORS policy on their submitted URLs, or turn off CORS in the browser, that’s up to them.   I don’t want to be involved.  If someone wants me to validate JSON, I will do my best not to record the JSON on a server somewhere.   It would be nice to load JSON from a URL to demonstrate any bugs in X_ITE or X3DOM, instead of doing a potentially buggy copy/paste.</div><div dir="auto"><br></div><div dir="auto">More suggestions for enhancements are welcome, including forks and pull requests on GitHub.</div><div dir="auto"><br></div><div dir="auto">I do think that getting a more automated approach is desirable, and the submitted URL is the first step.   Any automated client approach may include a JavaScript interpreter in Java.   I’m not prepared to go there yet, and if you don’t want to go that direction either, I won’t pursue it, we’ll have to wait until Java has officially supported JSON draft schema 2020-12 support, or you jump on a python or JavaScript (or other language) solution.   I can show you a couple of Python test programs if python interests you.</div><div dir="auto"><br></div><div dir="auto">I am trying to balance enhancements to old software with new requests.   I wasn’t even aware of any validation users before this.</div><div dir="auto"><br></div><div dir="auto">Anyway, I am glad to provide this important X3D JSON validator to the X3D community.   I know one has a choice of JSON validators, maybe some are not so easy to use and require  uploads to a remote server instead of loading directly into the browser.  Or they cost hundreds of dollars.  If you would like to fund this validator, please fund Ajv.   Thanks!</div><div dir="auto"><br></div><div dir="auto">Enjoy!</div><div dir="auto"><br></div><div dir="auto">John</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Feb 15, 2022 at 10:02 PM Brutzman, Donald (Don) (CIV) <<a href="mailto:brutzman@nps.edu">brutzman@nps.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><div lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word"><div class="m_5447604625650534190WordSection1"><p class="MsoNormal">Hi John.  Your application ran but provided an ambiguous result:<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><ul style="margin-top:0in" type="disc"><li class="m_5447604625650534190MsoListParagraph" style="margin-left:0in">“<a href="http://coderextreme.net" target="_blank">coderextreme.net</a> says: Valid or user clicked OK”<u></u><u></u></li></ul><p class="MsoNormal"><span style="font-size:10pt;font-family:"Courier New""><u style="font-family:"Courier New""></u> <u style="font-family:"Courier New""></u></span></p><p class="MsoNormal"><span style="font-size:10pt;font-family:"Courier New"">all the best, Don<u style="font-family:"Courier New""></u><u style="font-family:"Courier New""></u></span></p><p class="MsoNormal"><span style="font-size:10pt;font-family:"Courier New"">-- <u style="font-family:"Courier New""></u><u style="font-family:"Courier New""></u></span></p><p class="MsoNormal"><span style="font-size:10pt;font-family:"Courier New"">Don Brutzman  Naval Postgraduate School, Code USW/Br        <a href="mailto:brutzman@nps.edu" target="_blank" style="font-family:"Courier New"">brutzman@nps.edu</a><u style="font-family:"Courier New""></u><u style="font-family:"Courier New""></u></span></p><p class="MsoNormal"><span style="font-size:10pt;font-family:"Courier New"">Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA    +1.831.656.2149<u style="font-family:"Courier New""></u><u style="font-family:"Courier New""></u></span></p><p class="MsoNormal"><span style="font-size:10pt;font-family:"Courier New"">X3D graphics, virtual worlds, Navy robotics https://</span> <span style="font-size:10pt;font-family:"Courier New""><a href="http://faculty.nps.edu/brutzman" target="_blank" style="font-family:"Courier New"">faculty.nps.edu/brutzman</a><u style="font-family:"Courier New""></u><u style="font-family:"Courier New""></u></span></p></div></div><div lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word"><div class="m_5447604625650534190WordSection1"><p class="MsoNormal"><u></u> <u></u></p><div style="border-style:solid none none;border-top-width:1pt;padding:3pt 0in 0in;border-top-color:rgb(225,225,225)"><p class="MsoNormal"><b>From:</b> x3d-public <<a href="mailto:x3d-public-bounces@web3d.org" target="_blank">x3d-public-bounces@web3d.org</a>> <b>On Behalf Of </b>John Carlson<br><b>Sent:</b> Monday, February 14, 2022 4:54 PM<br><b>To:</b> X3D Graphics public mailing list <<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a>><br><b>Subject:</b> [x3d-public] New feature of X3D JSON validator: URLs<u></u><u></u></p></div><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal"><a href="https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcoderextreme.net%2FX3DJSONLD%2Fsrc%2Fmain%2Fhtml%2Fvalidator.html%3Fhttps%3A%2F%2Fcoderextreme.net%2FX3DJSONLD%2Fsrc%2Fmain%2Fdata%2Frubik.json&data=04%7C01%7Cbrutzman%40nps.edu%7C47e91961b51e4cbeed3408d9f01db93a%7C6d936231a51740ea9199f7578963378e%7C0%7C0%7C637804833362618013%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=w9IwF30J4tsDKtJ3CzvdPNuF1JNDSqrTyCRFKFdXswM%3D&reserved=0" target="_blank">https://coderextreme.net/X3DJSONLD/src/main/html/validator.html?https://coderextreme.net/X3DJSONLD/src/main/data/rubik.json</a><u></u><u></u></p><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">This will load the JSON into the web page without having to copy/paste. Note that the server following the ? will have to have the CORS setting (see CORS references on <a href="https://www.web3d.org/x3d/content/examples/X3dResources.html" target="_blank">https://www.web3d.org/x3d/content/examples/X3dResources.html</a>), or the origins should be the same.<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">The validator.html source code can be downloaded from:<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"><a href="https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcoderextreme%2FX3DJSONLD&data=04%7C01%7Cbrutzman%40nps.edu%7C47e91961b51e4cbeed3408d9f01db93a%7C6d936231a51740ea9199f7578963378e%7C0%7C0%7C637804833362618013%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=dGA3ehNw64WdSfpLT49MqwKISoUaaVLKc%2Beotz9E9Ng%3D&reserved=0" target="_blank">https://github.com/coderextreme/X3DJSONLD</a><u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Note that validation will not begin immediately, and will require that you click the validation link. above the JSON.<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">If anyone has good idea for enabling this link from a Java client, please let me know.  I want the errors from the alert to go back to the client.<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">John<u></u><u></u></p></div></div></div></div></blockquote></div></div>