Lines Matching +full:- +full:o
1 // Tencent is pleased to support the open source community by making RapidJSON available->
3 // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip-> All rights reserved->
6 // in compliance with the License-> You may obtain a copy of the License at
8 // http://opensource->org/licenses/MIT
12 // CONDITIONS OF ANY KIND, either express or implied-> See the License for the
13 // specific language governing permissions and limitations under the License->
60 RAPIDJSON_DIAG_OFF(weak-vtables)
61 RAPIDJSON_DIAG_OFF(exit-time-destructors)
62 RAPIDJSON_DIAG_OFF(c++98-compat-pedantic)
63 RAPIDJSON_DIAG_OFF(variadic-macros)
173 \brief User-defined kValidateDefaultFlags definition.
195 kDraftUnknown = -1,
209 kVersionUnknown = -1,
220 Specification(OpenApiVersion o) : oapi(o) { in Specification()
409 // FNV-1a from http://isthe.com/chongo/tech/comp/fnv/ in WriteBuffer()
538 uri_(schemaDocument->GetURI(), *allocator), in allocator_()
540 spec_(schemaDocument->GetSpecification()), in allocator_()
542 typeless_(schemaDocument->GetTypeless()), in allocator_()
546 type_((1 << kTotalSchemaType) - 1), // typeless in allocator_()
587 // recursion (with recursive schemas), since schemaDocument->getSchema() is always in allocator_()
591 SchemaEntry *entry = schemaDocument->schemaMap_.template Push<SchemaEntry>(); in allocator_()
593 schemaDocument->AddSchemaRefs(this); in allocator_()
599 // If we have an id property, resolve it with the in-scope id in allocator_()
603 if (v->IsString()) { in allocator_()
606 … RAPIDJSON_SCHEMA_PRINT(SchemaIds, id.GetString(), v->GetString(), id_.GetString()); in allocator_()
612 if (v->IsString()) in allocator_()
614 else if (v->IsArray()) in allocator_()
615 for (ConstValueIterator itr = v->Begin(); itr != v->End(); ++itr) in allocator_()
620 if (v->IsArray() && v->Size() > 0) { in allocator_()
621 enum_ = static_cast<uint64_t*>(allocator_->Malloc(sizeof(uint64_t) * v->Size())); in allocator_()
622 for (ConstValueIterator itr = v->Begin(); itr != v->End(); ++itr) { in allocator_()
627 itr->Accept(h); in allocator_()
642 … schemaDocument->CreateSchema(¬_, p.Append(GetNotString(), allocator_), *v, document, id_); in allocator_()
657 if (properties && properties->IsObject()) in allocator_()
658 … for (ConstMemberIterator itr = properties->MemberBegin(); itr != properties->MemberEnd(); ++itr) in allocator_()
659 AddUniqueElement(allProperties, itr->name); in allocator_()
661 if (required && required->IsArray()) in allocator_()
662 for (ConstValueIterator itr = required->Begin(); itr != required->End(); ++itr) in allocator_()
663 if (itr->IsString()) in allocator_()
668 if (dependencies && dependencies->IsObject()) in allocator_()
669 …for (ConstMemberIterator itr = dependencies->MemberBegin(); itr != dependencies->MemberEnd(); ++it… in allocator_()
670 AddUniqueElement(allProperties, itr->name); in allocator_()
671 if (itr->value.IsArray()) in allocator_()
672 for (ConstValueIterator i = itr->value.Begin(); i != itr->value.End(); ++i) in allocator_()
673 if (i->IsString()) in allocator_()
679 … properties_ = static_cast<Property*>(allocator_->Malloc(sizeof(Property) * propertyCount_)); in allocator_()
688 if (properties && properties->IsObject()) { in allocator_()
690 … for (ConstMemberIterator itr = properties->MemberBegin(); itr != properties->MemberEnd(); ++itr) { in allocator_()
692 if (FindPropertyIndex(itr->name, &index)) in allocator_()
693 …schemaDocument->CreateSchema(&properties_[index].schema, q.Append(itr->name, allocator_), itr->val… in allocator_()
701 …ternProperties_ = static_cast<PatternProperty*>(allocator_->Malloc(sizeof(PatternProperty) * v->Me… in allocator_()
704 for (ConstMemberIterator itr = v->MemberBegin(); itr != v->MemberEnd(); ++itr) { in allocator_()
706 PointerType r = q.Append(itr->name, allocator_); in allocator_()
707 … patternProperties_[patternPropertyCount_].pattern = CreatePattern(itr->name, schemaDocument, r); in allocator_()
708 …schemaDocument->CreateSchema(&patternProperties_[patternPropertyCount_].schema, r, itr->value, doc… in allocator_()
713 if (required && required->IsArray()) in allocator_()
714 for (ConstValueIterator itr = required->Begin(); itr != required->End(); ++itr) in allocator_()
715 if (itr->IsString()) { in allocator_()
725 if (dependencies && dependencies->IsObject()) { in allocator_()
728 …for (ConstMemberIterator itr = dependencies->MemberBegin(); itr != dependencies->MemberEnd(); ++it… in allocator_()
730 if (FindPropertyIndex(itr->name, &sourceIndex)) { in allocator_()
731 if (itr->value.IsArray()) { in allocator_()
732 …properties_[sourceIndex].dependencies = static_cast<bool*>(allocator_->Malloc(sizeof(bool) * prope… in allocator_()
734 …for (ConstValueIterator targetItr = itr->value.Begin(); targetItr != itr->value.End(); ++targetItr… in allocator_()
740 else if (itr->value.IsObject()) { in allocator_()
742 …schemaDocument->CreateSchema(&properties_[sourceIndex].dependenciesSchema, q.Append(itr->name, all… in allocator_()
751 if (v->IsBool()) in allocator_()
752 additionalProperties_ = v->GetBool(); in allocator_()
753 else if (v->IsObject()) in allocator_()
754 …schemaDocument->CreateSchema(&additionalPropertiesSchema_, p.Append(GetAdditionalPropertiesString(… in allocator_()
763 if (v->IsObject()) // List validation in allocator_()
764 schemaDocument->CreateSchema(&itemsList_, q, *v, document, id_); in allocator_()
765 else if (v->IsArray()) { // Tuple validation in allocator_()
766 … itemsTuple_ = static_cast<const Schema**>(allocator_->Malloc(sizeof(const Schema*) * v->Size())); in allocator_()
768 for (ConstValueIterator itr = v->Begin(); itr != v->End(); ++itr, index++) in allocator_()
769 …schemaDocument->CreateSchema(&itemsTuple_[itemsTupleCount_++], q.Append(index, allocator_), *itr, … in allocator_()
779 if (v->IsBool()) in allocator_()
780 additionalItems_ = v->GetBool(); in allocator_()
781 else if (v->IsObject()) in allocator_()
782 …schemaDocument->CreateSchema(&additionalItemsSchema_, p.Append(GetAdditionalItemsString(), allocat… in allocator_()
796 if (v->IsNumber()) in allocator_()
800 if (v->IsNumber()) in allocator_()
807 if (v->IsNumber() && v->GetDouble() > 0.0) in allocator_()
812 if (v->IsString()) in allocator_()
813 defaultValueLength_ = v->GetStringLength(); in allocator_()
815 // ReadOnly - open api only (until draft 7 supported) in allocator_()
816 // WriteOnly - open api 3 only (until draft 7 supported) in allocator_()
823 schemaDocument->SchemaError(kSchemaErrorReadOnlyAndWriteOnly, p); in allocator_()
825 // Nullable - open api 3 only in allocator_()
849 pattern_->~RegexType(); in ~Schema()
910 otherValid = context.patternPropertiesValidators[--count]->IsValid(); in EndValue()
914 if (!context.patternPropertiesValidators[i]->IsValid()) { in EndValue()
952 if (!context.validators[i]->IsValid()) { in EndValue()
959 if (context.validators[i]->IsValid()) in EndValue()
970 if (context.validators[i]->IsValid()) { in EndValue()
972 context.error_handler.MultipleOneOf(firstMatch, i - oneOf_.begin); in EndValue()
976 firstMatch = i - oneOf_.begin; in EndValue()
985 if (not_ && context.validators[notValidatorIndex_]->IsValid()) { in EndValue()
1098 if (patternProperties_) { // pre-allocate schema array in StartObject()
1167 if (properties_[index].schema->defaultValueLength_ == 0 ) in EndObject()
1197 if (!dependenciesValidator->IsValid()) in EndObject()
1284 static const ValueType v(s, static_cast<SizeType>(sizeof(s) / sizeof(Ch) - 1));\
1289 RAPIDJSON_STRING_(Boolean, 'b', 'o', 'o', 'l', 'e', 'a', 'n')
1290 RAPIDJSON_STRING_(Object, 'o', 'b', 'j', 'e', 'c', 't')
1297 RAPIDJSON_STRING_(AllOf, 'a', 'l', 'l', 'O', 'f')
1298 RAPIDJSON_STRING_(AnyOf, 'a', 'n', 'y', 'O', 'f')
1299 RAPIDJSON_STRING_(OneOf, 'o', 'n', 'e', 'O', 'f')
1300 RAPIDJSON_STRING_(Not, 'n', 'o', 't')
1301 RAPIDJSON_STRING_(Properties, 'p', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's')
1304 …RAPIDJSON_STRING_(PatternProperties, 'p', 'a', 't', 't', 'e', 'r', 'n', 'P', 'r', 'o', 'p', 'e', '…
1305 …STRING_(AdditionalProperties, 'a', 'd', 'd', 'i', 't', 'i', 'o', 'n', 'a', 'l', 'P', 'r', 'o', 'p'…
1306 … RAPIDJSON_STRING_(MinProperties, 'm', 'i', 'n', 'P', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's')
1307 … RAPIDJSON_STRING_(MaxProperties, 'm', 'a', 'x', 'P', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's')
1311 …RAPIDJSON_STRING_(AdditionalItems, 'a', 'd', 'd', 'i', 't', 'i', 'o', 'n', 'a', 'l', 'I', 't', 'e'…
1320 RAPIDJSON_STRING_(MultipleOf, 'm', 'u', 'l', 't', 'i', 'p', 'l', 'e', 'O', 'f')
1326 RAPIDJSON_STRING_(OpenApi, 'o', 'p', 'e', 'n', 'a', 'p', 'i')
1327 RAPIDJSON_STRING_(ReadOnly, 'r', 'e', 'a', 'd', 'O', 'n', 'l', 'y')
1328 RAPIDJSON_STRING_(WriteOnly, 'w', 'r', 'i', 't', 'e', 'O', 'n', 'l', 'y')
1372 return itr != value.MemberEnd() ? &(itr->value) : 0; in GetMember()
1377 if (v->IsBool()) in AssignIfExist()
1378 out = v->GetBool(); in AssignIfExist()
1383 if (v->IsUint64() && v->GetUint64() <= SizeType(~0)) in AssignIfExist()
1384 out = static_cast<SizeType>(v->GetUint64()); in AssignIfExist()
1389 if (v->IsArray() && v->Size() > 0) { in AssignIfExist()
1391 out.count = v->Size(); in AssignIfExist()
1392 … out.schemas = static_cast<const Schema**>(allocator_->Malloc(out.count * sizeof(const Schema*))); in AssignIfExist()
1406 …RegexType* r = new (allocator_->Malloc(sizeof(RegexType))) RegexType(value.GetString(), allocator_… in CreatePattern()
1407 if (!r->IsValid()) { in CreatePattern()
1408 … sd->SchemaErrorValue(kSchemaErrorRegexInvalid, p, value.GetString(), value.GetStringLength()); in CreatePattern()
1409 r->~RegexType(); in CreatePattern()
1426 RegexType *r = static_cast<RegexType*>(allocator_->Malloc(sizeof(RegexType))); in CreatePattern()
1431 … sd->SchemaErrorValue(kSchemaErrorRegexInvalid, p, value.GetString(), value.GetStringLength()); in CreatePattern()
1463 // Also a useful place to add type-independent error checks.
1474 // Always return after first failure for these sub-validators in CreateParallelValidator()
1494 // Add any other type-independent checks here in CreateParallelValidator()
1512 // O(n)
1570 if (static_cast<uint64_t>(i >= 0 ? i : -i) % multipleOf_.GetUint64() != 0) { in CheckInt()
1649 double r = a - q * b; in CheckDoubleMultipleOf()
1688 pattern->~RegexType(); in ~PatternProperty()
1755 …tic_cast<size_t>((sizeof(SizeType) == 4 ? u32toa(index, buffer) : u64toa(index, buffer)) - buffer); in AppendIndexToken()
1769 documentStack.template Pop<char>(static_cast<size_t>(10 - (end - buffer)));
1775 documentStack.template Pop<char>(static_cast<size_t>(20 - (end - buffer)));
1842 …tional schema draft or OpenAPI version. Used if no specification in document. Defaults to draft-04.
1867 typeless_ = static_cast<SchemaType*>(allocator_->Malloc(sizeof(SchemaType)));
1874 // Generate root schema, it will call CreateSchema() to create sub-schemas,
1921 schemaMap_.template Pop<SchemaEntry>(1)->~SchemaEntry();
1924 typeless_->~SchemaType();
2011 …const PointerType& p, SchemaType* s, bool o, Allocator* allocator) : pointer(p, allocator), schema…
2014 schema->~SchemaType();
2035 if (member->value.IsObject()) {
2037 errors.PushBack(member->value, *allocator_);
2038 member->value = errors;
2040 member->value.PushBack(error, *allocator_);
2054 static const StringRefType v(s, static_cast<SizeType>(sizeof(s) / sizeof(Ch) - 1)); \
2059 RAPIDJSON_STRING_(ErrorCode, 'e', 'r', 'r', 'o', 'r', 'C', 'o', 'd', 'e')
2061 RAPIDJSON_STRING_(Offset, 'o', 'f', 'f', 's', 'e', 't')
2064 RAPIDJSON_STRING_(SpecUnknown, 'S', 'p', 'e', 'c', 'U', 'n', 'k', 'n', 'o', 'w', 'n')
2065 …RAPIDJSON_STRING_(SpecUnsupported, 'S', 'p', 'e', 'c', 'U', 'n', 's', 'u', 'p', 'p', 'o', 'r', 't'…
2067 RAPIDJSON_STRING_(StartUnknown, 'S', 't', 'a', 'r', 't', 'U', 'n', 'k', 'n', 'o', 'w', 'n')
2070 …RAPIDJSON_STRING_(RefPointerInvalid, 'R', 'e', 'f', 'P', 'o', 'i', 'n', 't', 'e', 'r', 'I', 'n', '…
2071 RAPIDJSON_STRING_(RefUnknown, 'R', 'e', 'f', 'U', 'n', 'k', 'n', 'o', 'w', 'n')
2073 …ON_STRING_(RefNoRemoteProvider, 'R', 'e', 'f', 'N', 'o', 'R', 'e', 'm', 'o', 't', 'e', 'P', 'r', '…
2074 …RAPIDJSON_STRING_(RefNoRemoteSchema, 'R', 'e', 'f', 'N', 'o', 'R', 'e', 'm', 'o', 't', 'e', 'S', '…
2075 …G_(ReadOnlyAndWriteOnly, 'R', 'e', 'a', 'd', 'O', 'n', 'l', 'y', 'A', 'n', 'd', 'W', 'r', 'i', 't'…
2082 …, ':', '/', '/', 'j', 's', 'o', 'n', '-', 's', 'c', 'h', 'e', 'm', 'a', '.', 'o', 'r', 'g', '/', '…
2083 …, ':', '/', '/', 'j', 's', 'o', 'n', '-', 's', 'c', 'h', 'e', 'm', 'a', '.', 'o', 'r', 'g', '/', '…
2084 …, ':', '/', '/', 'j', 's', 'o', 'n', '-', 's', 'c', 'h', 'e', 'm', 'a', '.', 'o', 'r', 'g', '/', '…
2085 …, ':', '/', '/', 'j', 's', 'o', 'n', '-', 's', 'c', 'h', 'e', 'm', 'a', '.', 'o', 'r', 'g', '/', '…
2086 …, ':', '/', '/', 'j', 's', 'o', 'n', '-', 's', 'c', 'h', 'e', 'm', 'a', '.', 'o', 'r', 'g', '/', '…
2087 …'/', 'j', 's', 'o', 'n', '-', 's', 'c', 'h', 'e', 'm', 'a', '.', 'o', 'r', 'g', '/', 'd', 'r', 'a'…
2088 …'/', 'j', 's', 'o', 'n', '-', 's', 'c', 'h', 'e', 'm', 'a', '.', 'o', 'r', 'g', '/', 'd', 'r', 'a'…
2097 if (!itr->value.IsString()) return kDraftUnknown;
2098 const UriType draftUri(itr->value);
2129 if (!itr->value.IsString()) return kVersionUnknown;
2131 if (kVersion20Value == itr->value) return kVersion20; // must match 2.0 exactly
2133 …if (itr->value.GetStringLength() > len && kVersion30Value == ValueType(itr->value.GetString(), len…
2135 …if (itr->value.GetStringLength() > len && kVersion31Value == ValueType(itr->value.GetString(), len…
2169 … CreateSchemaRecursive(0, pointer.Append(itr->name, allocator_), itr->value, document, newid);
2190 …SchemaType* s = new (allocator_->Malloc(sizeof(SchemaType))) SchemaType(this, pointer, v, document…
2193 return s->GetId();
2217 if (itr->value.IsString()) {
2218 SizeType len = itr->value.GetStringLength();
2222 // First resolve $ref against the in-scope id
2224 UriType ref = UriType(itr->value, allocator_).Resolve(scopeId, allocator_);
2225 … RAPIDJSON_SCHEMA_PRINT(SchemaIds, id.GetString(), itr->value.GetString(), ref.GetString());
2231 // Remote reference - call the remote document provider
2235 …if (const GenericSchemaDocument* remoteDocument = remoteProvider_->GetRemoteDocument(ref, spec_)) {
2245 if (const SchemaType *sc = remoteDocument->GetSchema(pointer)) {
2278 …// Call CreateSchema recursively, but first compute the in-scope id for the $ref target as we have…
2279 // TODO: cache pointer <-> id mapping
2300 …// Call CreateSchema recursively, but first compute the in-scope id for the $ref target as we have…
2301 // TODO: cache pointer <-> id mapping
2324 // TODO cache pointer <-> id mapping
2333 if (m != doc.MemberEnd() && m->value.GetType() == kStringType) {
2334 localuri = UriType(m->value, allocator_).Resolve(baseuri, allocator_);
2345 if (m->value.GetType() == kObjectType || m->value.GetType() == kArrayType) {
2346 …resval = FindId(m->value, finduri, resptr, localuri, full, here.Append(m->name.GetString(), m->nam…
2353 if (v->GetType() == kObjectType || v->GetType() == kArrayType) {
2383 if (pointer == target->pointer)
2384 return target->schema;
2390 if (schema == target->schema)
2391 return target->pointer;
2405 internal::Stack<Allocator> schemaMap_; // Stores created Pointer -> Schemas
2681 MergeError(static_cast<GenericSchemaValidator*>(subvalidators[i])->GetError());
2716 static_cast<GenericSchemaValidator*>(subvalidator)->GetError(), GetStateAllocator());
2746 …reat allOf like oneOf and anyOf to match https://rapidjson.org/md_doc_schema.html#allOf-anyOf-oneOf
2749 // MergeError(static_cast<GenericSchemaValidator*>(subvalidators[i])->GetError());
2782 static const StringRefType v(s, static_cast<SizeType>(sizeof(s) / sizeof(Ch) - 1)); \
2790 RAPIDJSON_STRING_(Disallowed, 'd', 'i', 's', 'a', 'l', 'l', 'o', 'w', 'e', 'd')
2792 RAPIDJSON_STRING_(Errors, 'e', 'r', 'r', 'o', 'r', 's')
2793 RAPIDJSON_STRING_(ErrorCode, 'e', 'r', 'r', 'o', 'r', 'C', 'o', 'd', 'e')
2794 RAPIDJSON_STRING_(ErrorMessage, 'e', 'r', 'r', 'o', 'r', 'M', 'e', 's', 's', 'a', 'g', 'e')
2812 if (context->hasher)\
2813 static_cast<HasherType*>(context->hasher)->method arg2;\
2814 if (context->validators)\
2815 for (SizeType i_ = 0; i_ < context->validatorCount; i_++)\
2816 static_cast<GenericSchemaValidator*>(context->validators[i_])->method arg2;\
2817 if (context->patternPropertiesValidators)\
2818 for (SizeType i_ = 0; i_ < context->patternPropertiesValidatorCount; i_++)\
2819 … static_cast<GenericSchemaValidator*>(context->patternPropertiesValidators[i_])->method arg2;\
2823 …valid_ = (EndValue() || GetContinueOnErrors()) && (!outputHandler_ || outputHandler_->method arg2)…
2847 valid_ = !outputHandler_ || outputHandler_->StartObject();
2860 valid_ = !outputHandler_ || outputHandler_->Key(str, len, copy);
2879 valid_ = !outputHandler_ || outputHandler_->StartArray();
2905 …sv->SetValidateFlags(inheritContinueOnErrors ? GetValidateFlags() : GetValidateFlags() & ~(unsigne…
2911 v->~GenericSchemaValidator();
2920 return static_cast<HasherType*>(hasher)->GetHashCode();
2925 h->~HasherType();
3020 schemaDocument_->GetPointer(&CurrentSchema()).StringifyUriFragment(sb);
3025 …uint64_t h = hasher && CurrentContext().arrayUniqueness ? static_cast<HasherType*>(hasher)->GetHas…
3036 … for (typename HashCodeArray::ConstValueIterator itr = a->Begin(); itr != a->End(); ++itr)
3037 if (itr->GetUint64() == h) {
3038 DuplicateItems(static_cast<SizeType>(itr - a->Begin()), a->Size());
3041 a->PushBack(h, GetStateAllocator());
3046 a->PushBack(h, GetStateAllocator());
3078 if (HashCodeArray* a = static_cast<HashCodeArray*>(c->arrayElementHashCodes)) {
3079 a->~HashCodeArray();
3082 c->~Context();
3089 ? PointerType(instancePointer.GetTokens(), instancePointer.GetTokenCount() - 1)
3116 if (member->value.IsObject()) {
3118 errors.PushBack(member->value, GetStateAllocator());
3119 member->value = errors;
3121 member->value.PushBack(error, GetStateAllocator());
3134 AddError(it->name, it->value);
3152 …errors.PushBack(static_cast<GenericSchemaValidator*>(subvalidators[i])->GetError(), GetStateAlloca…
3158 … const SchemaType& CurrentSchema() const { return *schemaStack_.template Top<Context>()->schema; }