[x3d-public] draft-07 JSON schema not broken, I've used it for a long time
John Carlson
yottzumm at gmail.com
Thu May 14 17:10:09 PDT 2020
Per our meeting this afternoon, Don, JSON schema draft-07 "eats own dog
food"
https://github.com/everit-org/json-schema
Apache 2.0 licensed
Which validator tool did you use to validate 2019-19 against itself?
That's why I've stuck with draft-07, no tool support. That is, a JSON
schema file can't validate itself without necessary code.
I've been a happy customer of draft-07. Maybe we can spend some time with
this repository so you achieve more happiness with with Java/JSON schema.
Also, if you're friendly with JavaScript:
https://github.com/hyperjump-io/json-schema-validator
I'm sticking with Ajv for now, unless the standardization produces
something. I've got schema generators for all X3D versions.
Dog food test below (`maven clean package` first):
Classpath:
CLASSPATH=.;C:/Users/coderextreme/.m2/repository/com/google/re2j/re2j/1.1/re2j-1.1.jar;C:/Users/coderextreme/.m2/repository/com/google/collections/google-collections/1.0/google-collections-1.0.jar;C:/Users/coderextreme/.m2/repository/org/json/json/20180130/json-20180130.jar;C:/Users/coderextreme/.m2/repository/com/damnhandy/handy-uri-templates/2.1.6/handy-uri-templates-2.1.6.jar;json-schema/core/target/org.everit.json.schema-1.10.0.jar
Meta schema test code:
/*
* Copyright (C) 2011 Everit Kft. (http://www.everit.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import org.everit.json.schema.loader.SchemaLoader;
import org.everit.json.schema.Schema;
import org.json.JSONObject;
import org.json.JSONTokener;
public class MetaSchemaTest {
public static void main(String args[]) {
JSONObject jsonSchema = new JSONObject(new JSONTokener(
MetaSchemaTest.class
.getResourceAsStream("json-schema-draft-07.json")));
JSONObject jsonSubject = new JSONObject(new JSONTokener(
MetaSchemaTest.class
.getResourceAsStream("json-schema-draft-07.json")));
Schema schema = SchemaLoader.load(jsonSchema);
schema.validate(jsonSubject);
}
}
John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20200514/77c55f9d/attachment.html>
More information about the x3d-public
mailing list