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
A public namespace must contain the `microsoft.graph.` prefix and be presented in camel
25
-
case; that is, `microsoft.graph.myNamespace`.
25
+
case; that is, `microsoft.graph.myNamespace`. Elements defined in namespaces not prefixed
26
+
with `microsoft.graph` will be mapped to the public `microsoft.graph` namespace.
27
+
28
+
Namespaces should not include more than two segments following the `microsoft.graph` prefix;
29
+
that is, `microsoft.graph.myNamespace.mySubNamespace`.
30
+
31
+
Public namespaces must define an alias, and that alias must be the concatenation of
32
+
the segments following the `microsoft.graph` prefix with proper camel casing rules applied;
33
+
that is, `myNamespaceMySubNamespace`.
26
34
27
35
When type casting is required in the API query, request, or response, a fully
28
-
qualified type name is represented as concatenation of a namespace and a type
29
-
name. For a consistent user experience, namespaces MUST be aligned with the corresponding API category path segment.
36
+
qualified type name is represented as concatenation of the namespace or alias,
37
+
followed by a dot (`.`) and the type name.
30
38
31
39
## When to use this pattern
32
40
33
41
API resource grouping creates a user-friendly experience, keeping all resources for a specific feature close together and limiting the length of IDE prompts such as auto-complete in some programming languages.
34
42
35
-
We recommend that a new namespace be aligned with a top-level API category.
43
+
For a consistent user experience, new namespace should be aligned with a top-level API category.
36
44
37
45
## Issues and considerations
38
46
39
-
- Microsoft Graph consistency requirements discourage using the same type names for different concepts even within different namespaces. Microsoft Graph type names must be descriptive and unique within the API surface without requiring full qualification.
47
+
- Microsoft Graph consistency requirements discourage using the same type names for different concepts even within different namespaces. Microsoft Graph type names must be descriptive and should represent a single concept across the API Surface.
40
48
41
49
- A namespace must be consistent with an API category in the navigation path according to [Microsoft Graph REST API Guidelines](../GuidelinesGraph.md#uniform-resource-locators-urls).
42
50
43
-
-When type name is ambiguous and requires a namespace qualifier, changing a namespace is a breaking change.
51
+
-Changing a namespace prefixed with `microsoft.graph`, or moving types between, into, or out of a namespace prefixed with `microsoft.graph`, is a breaking change.
44
52
45
53
- To extend a type in a different schema, a service must declare that schema and the type in it. This is conceptually similar to .NET partial types.
46
54
@@ -51,17 +59,19 @@ We recommend that a new namespace be aligned with a top-level API category.
51
59
- Microsoft Graph has some predefined constraints for declared namespaces:
52
60
53
61
- All public namespaces must have the prefix `microsoft.graph`.
62
+
63
+
- Public namespaces must declare an alias that is the concatenation of the segments following the `microsoft.graph` prefix.
64
+
65
+
- At most, two levels of nesting below `microsoft.graph` is recommended.
54
66
55
-
- Only one level of nesting deeper than `microsoft.graph` is supported.
56
-
57
-
- If a namespace does not begin with the `microsoft.graph` prefix, all types in the schema are coerced into the main `microsoft.graph` namespace.
67
+
- If a namespace does not begin with the `microsoft.graph` prefix, all types in the schema are mapped into the public `microsoft.graph` namespace.
0 commit comments