You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All resources declared within the namespace will be grouped together in the public
26
-
Graph metadata and may be used for partitioning.
26
+
All resources declared within the namespace will be grouped together in the
27
+
public Graph metadata and may be used for partitioning.
27
28
28
29
A public namespace must have "microsoft.graph.” prefix and be presented in camel
29
30
case, i.e microsoft.graph.myNamespace.
30
31
31
-
When type casting is required in the API query, request or response a fully-qualified type name is represented as concatenation of a namespace and a type name. Consequently namespace should be aligned with API category
32
-
path segment.
32
+
When type casting is required in the API query, request or response a fully
33
+
qualified type name is represented as concatenation of a namespace and a type
34
+
name. Consequently namespace should be aligned with API category path segment.
33
35
34
36
## When to Use this Pattern
35
37
36
38
API resource grouping creates a user-friendly experience keeping all resources
37
-
for a specific use case close together. It also allows generating smaller SDKs
39
+
for a specific feature close together. It also allows generating smaller SDKs
38
40
and libraries and limits length of IDE prompts such as Intellisense.
39
41
42
+
We recommend creating a new namespace when a new top-level API category is
43
+
introduced.
40
44
41
45
## Issues and Considerations
42
46
@@ -47,33 +51,78 @@ and libraries and limits length of IDE prompts such as Intellisense.
47
51
48
52
2. Namespace must be consistent with API navigation path.
49
53
50
-
3. When type name is ambiguous and requires a namespace qualifier changing namespace is a breaking change.
51
-
54
+
3. When type name is ambiguous and requires a namespace qualifier, changing
55
+
namespace is a breaking change.
52
56
53
57
4. To extend a type in a different schema, a service must declare that schema
54
58
and the type in it. This is conceptually similar to .NET partial types.
55
59
56
60
5. To reference a type in a different schema, simply refer to that type by
57
61
fully qualified name (namespace + type name).
58
-
6. Microsoft Graph has heuristic rules for declared namespaces:
59
62
60
-
- All public namespaces must have a prefix ‘microsoft.graph’
63
+
6. Cyclical references between namespaces are not allowed as many
64
+
object-oriented languages don’t support a cycle in inheritance.
65
+
66
+
7. Microsoft Graph has heuristic rules for declared namespaces:
61
67
62
-
- If a namespace does not begin with ‘microsoft.graph’ prefix, all types in
63
-
the schema will be coerced into the main ‘microsoft.graph’ namespace.
68
+
1. All public namespaces must have a prefix ‘microsoft.graph’
69
+
70
+
2. If a namespace does not begin with ‘microsoft.graph’ prefix, all types
71
+
in the schema will be coerced into the main ‘microsoft.graph’ namespace.
64
72
65
73
## Example
66
74
67
-
Namespace and type declarations:
68
-
```XML
75
+
### Namespace and type declarations:
69
76
77
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ XML
0 commit comments