Home | History | Annotate | Download | only in policy

Lines Matching refs:schema

17 namespace schema = json_schema_constants;
36 // Returns the Value type described in |schema|, or |default_type| if not found.
37 base::Value::Type GetValueTypeForSchema(const base::DictionaryValue* schema,
39 // JSON-schema types to base::Value::Type mapping.
41 // JSON schema type.
46 { schema::kArray, base::Value::TYPE_LIST },
47 { schema::kBoolean, base::Value::TYPE_BOOLEAN },
48 { schema::kInteger, base::Value::TYPE_INTEGER },
49 { schema::kNull, base::Value::TYPE_NULL },
50 { schema::kNumber, base::Value::TYPE_DOUBLE },
51 { schema::kObject, base::Value::TYPE_DICTIONARY },
52 { schema::kString, base::Value::TYPE_STRING },
55 if (!schema)
58 if (!schema->GetStringWithoutPathExpansion(schema::kType, &type))
67 // Returns the schema for property |name| given the |schema| of an object.
68 // Returns the "additionalProperties" schema if no specific schema for
69 // |name| is present. Returns NULL if no schema is found.
70 const base::DictionaryValue* GetSchemaFor(const base::DictionaryValue* schema,
73 GetEntry(schema, schema::kProperties);
78 return GetEntry(schema, schema::kAdditionalProperties);
81 // Converts a value (as read from the registry) to meet |schema|, converting
85 const base::DictionaryValue* schema) {
86 // Figure out the type to convert to from the schema.
88 GetValueTypeForSchema(schema, value.GetType()));
92 // Recurse for complex types if there is a schema.
93 if (schema) {
101 ConvertValue(entry.value(), GetSchemaFor(schema, entry.key())));
109 GetEntry(schema, schema::kItems);
161 GetEntry(schema, schema::kItems);
351 const base::DictionaryValue* schema) const {
353 GetValueTypeForSchema(schema, base::Value::TYPE_DICTIONARY);
362 GetSchemaFor(schema, entry->first)).release());
369 GetSchemaFor(schema, entry->first)).release());
376 GetEntry(schema, schema::kItems);
394 LOG(WARNING) << "Can't convert registry key to schema type " << type;