Commit a74cecf3 authored by Giovanni Ortuño Urquidi's avatar Giovanni Ortuño Urquidi Committed by Commit Bot

policy: Add docs about schemas in policies

Adds docs that point to the code that validates the schemas in
policy_templates.json and that valides JSON Objects against the
schemas in policy_templates.json

Bug: 856901
Change-Id: I534c0bf58f4ff581ada4f704fc7ae0b6223f3337
Reviewed-on: https://chromium-review.googlesource.com/1116407Reviewed-by: default avatarLutz Justen <ljusten@chromium.org>
Commit-Queue: Giovanni Ortuño Urquidi <ortuno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#570934}
parent b4624cd3
...@@ -56,6 +56,10 @@ typedef std::vector<Schema> SchemaList; ...@@ -56,6 +56,10 @@ typedef std::vector<Schema> SchemaList;
// types of inner elements, for structured types. // types of inner elements, for structured types.
// Objects of this class refer to external, immutable data and are cheap to // Objects of this class refer to external, immutable data and are cheap to
// copy. // copy.
//
// Schema validation is based on a subset of the JSON Schema standard.
// TODO(crbug.com/856901): Document the supported subset of the JSON Schema
// standard.
class POLICY_EXPORT Schema { class POLICY_EXPORT Schema {
public: public:
// Used internally to store shared data. // Used internally to store shared data.
......
...@@ -142,6 +142,11 @@ ...@@ -142,6 +142,11 @@
# #
# Schemas: # Schemas:
# All policies have a key 'schema' which describes the schema of the policy. # All policies have a key 'schema' which describes the schema of the policy.
# This schema supports a subset of the JSON Schema standard. For more
# information see //components/json_schema/json_schema_validator.h
# which validates the schema and //components/policy/core/common/schema.h
# which validates instances against the specified schema.
#
# For many policies this is simply a type eg 'boolean' or 'string', but for # For many policies this is simply a type eg 'boolean' or 'string', but for
# 'dict' policies this describes the types of not only the root object, but # 'dict' policies this describes the types of not only the root object, but
# also all of its descendants. This schema data is used to validate 'dict' # also all of its descendants. This schema data is used to validate 'dict'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment