Skip to content

Commit b08672d

Browse files
Steve Hansonmiloyip
Steve Hanson
authored andcommitted
review comment updates
1 parent 55eca66 commit b08672d

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

doc/features.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,15 @@
2222
* RapidJSON should be fully RFC4627/ECMA-404 compliance.
2323
* Support JSON Pointer (RFC6901).
2424
* Support JSON Schema Draft v4.
25+
* Support Swagger v2 schema.
26+
* Support OpenAPI v3.0.x schema.
2527
* Support Unicode surrogate.
2628
* Support null character (`"\u0000"`)
27-
* For example, `["Hello\u0000World"]` can be parsed and handled gracefully. There is API for getting/setting lengths of string.
29+
* For example, `["Hello\u0000World"]` can be parsed and handled gracefully. There is API for getting/setting lengths of string.
2830
* Support optional relaxed syntax.
29-
* Single line (`// ...`) and multiple line (`/* ... */`) comments (`kParseCommentsFlag`).
30-
* Trailing commas at the end of objects and arrays (`kParseTrailingCommasFlag`).
31-
* `NaN`, `Inf`, `Infinity`, `-Inf` and `-Infinity` as `double` values (`kParseNanAndInfFlag`)
31+
* Single line (`// ...`) and multiple line (`/* ... */`) comments (`kParseCommentsFlag`).
32+
* Trailing commas at the end of objects and arrays (`kParseTrailingCommasFlag`).
33+
* `NaN`, `Inf`, `Infinity`, `-Inf` and `-Infinity` as `double` values (`kParseNanAndInfFlag`)
3234
* [NPM compliant](http://github.com/Tencent/rapidjson/blob/master/doc/npm.md).
3335

3436
## Unicode

doc/schema.md

+8
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,15 @@ if (sd.Parse(schemaJson).HasParseError()) {
2424
// the schema is not a valid JSON.
2525
// ...
2626
}
27+
2728
SchemaDocument schema(sd); // Compile a Document to SchemaDocument
29+
if (!schema.GetError().ObjectEmpty()) {
30+
// there was a problem compiling the schema
31+
StringBuffer sb;
32+
Writer<StringBuffer> w(sb);
33+
schema.GetError().Accept(w);
34+
printf("Invalid schema: %s\n", sb.GetString());
35+
}
2836
// sd is no longer needed here.
2937

3038
Document d;

include/rapidjson/schema.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -1794,7 +1794,8 @@ class IGenericRemoteSchemaDocumentProvider {
17941794
virtual const SchemaDocumentType* GetRemoteDocument(const GenericUri<ValueType, AllocatorType> uri, Specification& spec) {
17951795
// Default implementation just calls through for compatibility
17961796
// Following line suppresses unused parameter warning
1797-
if (false) printf("GetRemoteDocument: %d %d\n", spec.draft, spec.oapi);
1797+
(void)spec;
1798+
// printf("GetRemoteDocument: %d %d\n", spec.draft, spec.oapi);
17981799
return GetRemoteDocument(uri.GetBaseString(), uri.GetBaseStringLength());
17991800
}
18001801
};

0 commit comments

Comments
 (0)