diff --git a/doc/features.md b/doc/features.md index 0d79e7f..4d15937 100644 --- a/doc/features.md +++ b/doc/features.md @@ -22,13 +22,15 @@ * RapidJSON should be fully RFC4627/ECMA-404 compliance. * Support JSON Pointer (RFC6901). * Support JSON Schema Draft v4. +* Support Swagger v2 schema. +* Support OpenAPI v3.0.x schema. * Support Unicode surrogate. * Support null character (`"\u0000"`) - * For example, `["Hello\u0000World"]` can be parsed and handled gracefully. There is API for getting/setting lengths of string. +* For example, `["Hello\u0000World"]` can be parsed and handled gracefully. There is API for getting/setting lengths of string. * Support optional relaxed syntax. - * Single line (`// ...`) and multiple line (`/* ... */`) comments (`kParseCommentsFlag`). - * Trailing commas at the end of objects and arrays (`kParseTrailingCommasFlag`). - * `NaN`, `Inf`, `Infinity`, `-Inf` and `-Infinity` as `double` values (`kParseNanAndInfFlag`) +* Single line (`// ...`) and multiple line (`/* ... */`) comments (`kParseCommentsFlag`). +* Trailing commas at the end of objects and arrays (`kParseTrailingCommasFlag`). +* `NaN`, `Inf`, `Infinity`, `-Inf` and `-Infinity` as `double` values (`kParseNanAndInfFlag`) * [NPM compliant](http://github.com/Tencent/rapidjson/blob/master/doc/npm.md). ## Unicode diff --git a/doc/schema.md b/doc/schema.md index 238d7a5..4da4474 100644 --- a/doc/schema.md +++ b/doc/schema.md @@ -24,7 +24,15 @@ if (sd.Parse(schemaJson).HasParseError()) { // the schema is not a valid JSON. // ... } + SchemaDocument schema(sd); // Compile a Document to SchemaDocument +if (!schema.GetError().ObjectEmpty()) { + // there was a problem compiling the schema + StringBuffer sb; + Writer w(sb); + schema.GetError().Accept(w); + printf("Invalid schema: %s\n", sb.GetString()); +} // sd is no longer needed here. Document d; diff --git a/include/rapidjson/schema.h b/include/rapidjson/schema.h index 0e45df6..6e51177 100644 --- a/include/rapidjson/schema.h +++ b/include/rapidjson/schema.h @@ -1794,7 +1794,8 @@ public: virtual const SchemaDocumentType* GetRemoteDocument(const GenericUri uri, Specification& spec) { // Default implementation just calls through for compatibility // Following line suppresses unused parameter warning - if (false) printf("GetRemoteDocument: %d %d\n", spec.draft, spec.oapi); + (void)spec; + // printf("GetRemoteDocument: %d %d\n", spec.draft, spec.oapi); return GetRemoteDocument(uri.GetBaseString(), uri.GetBaseStringLength()); } };