Skip to content

Commit 9fbcaa5

Browse files
authored
Update dictionary.md
1 parent b845104 commit 9fbcaa5

File tree

1 file changed

+31
-21
lines changed

1 file changed

+31
-21
lines changed

graph/patterns/dictionary.md

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,13 @@ For more information, see the [OData reference](https://github.com/oasis-tcs/oda
4141
The following example demonstrates defining a dictionary that can contain string values.
4242

4343
```xml
44-
<Schema Namespace="WorkloadNamespace">
44+
<Schema Namespace="microsoft.graph">
4545
<ComplexType Name="Dictionary" OpenType="true">
4646
<Annotation Term="Core.Description" String="A dictionary of name-value pairs. Names must be valid property names, values may be restricted to a list of types via an annotation with term `Validation.OpenPropertyTypeConstraint`." />
4747
</ComplexType>
48-
<ComplexType Name="stringDictionary" OpenType="true" BaseType="WorkloadNamespace.Dictionary">
48+
</Schema>
49+
<Schema Namespace="WorkloadNamespace">
50+
<ComplexType Name="stringDictionary" OpenType="true" BaseType="microsoft.graph.Dictionary">
4951
<Annotation Term="Org.OData.Validation.V1.OpenPropertyTypeConstraint">
5052
<Collection>
5153
<String>Edm.String</String>
@@ -64,7 +66,7 @@ The following example shows defining a dictionary property, "userTags", on the i
6466
```xml
6567
<EntityType Name="item">
6668
...
67-
<Property Name="userTags" Type="self.stringDictionary"/>
69+
<Property Name="userTags" Type="WorkloadNamespace.stringDictionary"/>
6870
</EntityType>
6971
```
7072

@@ -117,25 +119,33 @@ Dictionaries can also contain complex types whose values may be constrained to a
117119
The following example defines a complex type **roleSettings**, an **assignedRoleGroupDictionary** that contains **roleSettings**, and an **assignedRoles** property that uses the dictionary..
118120

119121
```xml
120-
<EntityType Name="principal">
121-
...
122-
<Property Name="assignedRoles" Type="self.assignedRoleGroupDictionary">
123-
</EntityType>
124122

125-
<ComplexType Name="roleSettings">
126-
<Property Name ="domain" Type="Edm.String" Nullable="false" />
127-
</ComplexType>
128-
129-
<ComplexType Name="assignedRoleGroupDictionary" BaseType="graph.Dictionary">
130-
<!-- Note: Strongly-typed dictionary
131-
of roleSettings
132-
keyed by name of roleGroup. -->
133-
<Annotation Term="Org.OData.Validation.V1.OpenPropertyTypeConstraint">
134-
<Collection>
135-
<String>microsoft.graph.roleSettings</String>
136-
</Collection>
137-
</Annotation>
138-
</ComplexType>
123+
<Schema Namespace="microsoft.graph">
124+
<ComplexType Name="Dictionary" OpenType="true">
125+
<Annotation Term="Core.Description" String="A dictionary of name-value pairs. Names must be valid property names, values may be restricted to a list of types via an annotation with term `Validation.OpenPropertyTypeConstraint`." />
126+
</ComplexType>
127+
</Schema>
128+
<Schema Namespace="WorkloadNamespace">
129+
<EntityType Name="principal">
130+
...
131+
<Property Name="assignedRoles" Type="WorkloadNamespace.assignedRoleGroupDictionary">
132+
</EntityType>
133+
134+
<ComplexType Name="roleSettings">
135+
<Property Name ="domain" Type="Edm.String" Nullable="false" />
136+
</ComplexType>
137+
138+
<ComplexType Name="assignedRoleGroupDictionary" BaseType="microsoft.graph.Dictionary">
139+
<!-- Note: Strongly-typed dictionary
140+
of roleSettings
141+
keyed by name of roleGroup. -->
142+
<Annotation Term="Org.OData.Validation.V1.OpenPropertyTypeConstraint">
143+
<Collection>
144+
<String>microsoft.graph.roleSettings</String>
145+
</Collection>
146+
</Annotation>
147+
</ComplexType>
148+
</Schema>
139149
```
140150

141151
### Reading a entity with a complex-typed dictionary

0 commit comments

Comments
 (0)