Skip to content

Commit

Permalink
review comment updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve Hanson authored and miloyip committed Dec 18, 2022
1 parent 55eca66 commit b08672d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
10 changes: 6 additions & 4 deletions doc/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions doc/schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<StringBuffer> w(sb);
schema.GetError().Accept(w);
printf("Invalid schema: %s\n", sb.GetString());
}
// sd is no longer needed here.

Document d;
Expand Down
3 changes: 2 additions & 1 deletion include/rapidjson/schema.h
Original file line number Diff line number Diff line change
Expand Up @@ -1794,7 +1794,8 @@ class IGenericRemoteSchemaDocumentProvider {
virtual const SchemaDocumentType* GetRemoteDocument(const GenericUri<ValueType, AllocatorType> 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());
}
};
Expand Down

0 comments on commit b08672d

Please sign in to comment.