review comment updates
This commit is contained in:
parent
55eca66f39
commit
b08672d469
@ -22,13 +22,15 @@
|
|||||||
* RapidJSON should be fully RFC4627/ECMA-404 compliance.
|
* RapidJSON should be fully RFC4627/ECMA-404 compliance.
|
||||||
* Support JSON Pointer (RFC6901).
|
* Support JSON Pointer (RFC6901).
|
||||||
* Support JSON Schema Draft v4.
|
* Support JSON Schema Draft v4.
|
||||||
|
* Support Swagger v2 schema.
|
||||||
|
* Support OpenAPI v3.0.x schema.
|
||||||
* Support Unicode surrogate.
|
* Support Unicode surrogate.
|
||||||
* Support null character (`"\u0000"`)
|
* 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.
|
* Support optional relaxed syntax.
|
||||||
* Single line (`// ...`) and multiple line (`/* ... */`) comments (`kParseCommentsFlag`).
|
* Single line (`// ...`) and multiple line (`/* ... */`) comments (`kParseCommentsFlag`).
|
||||||
* Trailing commas at the end of objects and arrays (`kParseTrailingCommasFlag`).
|
* Trailing commas at the end of objects and arrays (`kParseTrailingCommasFlag`).
|
||||||
* `NaN`, `Inf`, `Infinity`, `-Inf` and `-Infinity` as `double` values (`kParseNanAndInfFlag`)
|
* `NaN`, `Inf`, `Infinity`, `-Inf` and `-Infinity` as `double` values (`kParseNanAndInfFlag`)
|
||||||
* [NPM compliant](http://github.com/Tencent/rapidjson/blob/master/doc/npm.md).
|
* [NPM compliant](http://github.com/Tencent/rapidjson/blob/master/doc/npm.md).
|
||||||
|
|
||||||
## Unicode
|
## Unicode
|
||||||
|
@ -24,7 +24,15 @@ if (sd.Parse(schemaJson).HasParseError()) {
|
|||||||
// the schema is not a valid JSON.
|
// the schema is not a valid JSON.
|
||||||
// ...
|
// ...
|
||||||
}
|
}
|
||||||
|
|
||||||
SchemaDocument schema(sd); // Compile a Document to SchemaDocument
|
SchemaDocument schema(sd); // Compile a Document to SchemaDocument
|
||||||
|
if (!schema.GetError().ObjectEmpty()) {
|
||||||
|
// there was a problem compiling the schema
|
||||||
|
StringBuffer sb;
|
||||||
|
Writer<StringBuffer> w(sb);
|
||||||
|
schema.GetError().Accept(w);
|
||||||
|
printf("Invalid schema: %s\n", sb.GetString());
|
||||||
|
}
|
||||||
// sd is no longer needed here.
|
// sd is no longer needed here.
|
||||||
|
|
||||||
Document d;
|
Document d;
|
||||||
|
@ -1794,7 +1794,8 @@ public:
|
|||||||
virtual const SchemaDocumentType* GetRemoteDocument(const GenericUri<ValueType, AllocatorType> uri, Specification& spec) {
|
virtual const SchemaDocumentType* GetRemoteDocument(const GenericUri<ValueType, AllocatorType> uri, Specification& spec) {
|
||||||
// Default implementation just calls through for compatibility
|
// Default implementation just calls through for compatibility
|
||||||
// Following line suppresses unused parameter warning
|
// 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());
|
return GetRemoteDocument(uri.GetBaseString(), uri.GetBaseStringLength());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user