Skip to content

Commit 7653778

Browse files
committed
formatting
1 parent 3c4dacf commit 7653778

File tree

3 files changed

+33
-25
lines changed

3 files changed

+33
-25
lines changed

graph/articles/collections.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Collections MAY support delta queries, see the [Change Tracking pattern](../patt
88

99
## 2. Serialization
1010

11-
Collections are represented in JSON using standard array notation for `value` property.
11+
Collections are represented in JSON using standard array notation for `value` property.
1212

1313
## 3. Collection URL patterns
1414

@@ -108,7 +108,6 @@ And once executed again, would likely lead to another resource:
108108
Location: https://graph.microsoft.com/beta/teamwork/devices/124
109109
```
110110

111-
112111
## 6. Sorting collections
113112

114113
The results of a collection query MAY be sorted based on property values.
@@ -153,7 +152,6 @@ Will return all devices sorted by companyAssetTag in descending order and a seco
153152

154153
Sorting MUST compose with filtering see [Odata 4.01 spec](https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part2-url-conventions.html#_Toc31361038) for more details.
155154

156-
157155
### 6.1. Interpreting a sorting expression
158156

159157
Sorting parameters MUST be consistent across pages, as both client and server-side paging is fully compatible with sorting.
@@ -301,9 +299,9 @@ When these operations are performed together, the evaluation order MUST be:
301299

302300
## 10. Empty Results
303301

304-
When a filter is performed on a collection and the result set is empty you MUST respond with a valid response body and a 200 response code.
305-
In this example the filters supplied by the client resulted in a empty result set.
306-
The response body is returned as normal and the _value_ attribute is set to a empty collection.
302+
When a filter is performed on a collection and the result set is empty you MUST respond with a valid response body and a 200 response code.
303+
In this example the filters supplied by the client resulted in a empty result set.
304+
The response body is returned as normal and the _value_ attribute is set to a empty collection.
307305
You SHOULD maintain consistency in your API whenever possible.
308306

309307
```http

graph/articles/errorResponses.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Services can avoid breaking changes by adding new error codes to "innererror" in
2121

2222
The value for the "message" name/value pair MUST be a human-readable representation of the error.
2323
It is intended as an aid to developers and is not suitable for exposure to end users.
24-
Services wanting to expose a suitable message for end users MUST do so through an [annotation][odata-json-annotations] or custom property.
24+
Services wanting to expose a suitable message for end users MUST do so through an [odata-json-annotations](https://docs.oasis-open.org/odata/odata-json-format/v4.01/cs02/odata-json-format-v4.01-cs02.html#sec_AnnotateaJSONObject) or custom property.
2525
Services SHOULD NOT localize "message" for the end user, because doing so might make the value unreadable to the app developer who may be logging the value, as well as make the value less searchable on the Internet.
2626

2727
The value for the "target" name/value pair is the target of the particular error (e.g., the name of the property in error).
@@ -42,17 +42,17 @@ Error objects MAY also include custom server-defined name/value pairs that MAY b
4242
Error types with custom server-defined properties SHOULD be declared in the service's metadata document.
4343
See example below.
4444

45-
Error responses MAY contain [annotations][odata-json-annotations] in any of their JSON objects.
45+
Error responses MAY contain Odata JSON annotations in any of their JSON objects.
4646

4747
We recommend that for any transient errors that may be retried, services SHOULD include a Retry-After HTTP header indicating the minimum number of seconds that clients SHOULD wait before attempting the operation again.
4848

49-
##### ErrorResponse : Object
49+
## ErrorResponse : Object
5050

5151
Property | Type | Required | Description
5252
-------- | ---- | -------- | -----------
5353
`error` | Error | ✔ | The error object.
5454

55-
##### Error : Object
55+
## Error : Object
5656

5757
Property | Type | Required | Description
5858
-------- | ---- | -------- | -----------
@@ -62,14 +62,14 @@ Property | Type | Required | Description
6262
`details` | Error[] | | An array of details about specific errors that led to this reported error.
6363
`innererror` | InnerError | | An object containing more specific information than the current object about the error.
6464

65-
##### InnerError : Object
65+
## InnerError : Object
6666

6767
Property | Type | Required | Description
6868
-------- | ---- | -------- | -----------
6969
`code` | String | | A more specific error code than was provided by the containing error.
7070
`innererror` | InnerError | | An object containing more specific information than the current object about the error.
7171

72-
##### Examples
72+
## Examples
7373

7474
Example of "innererror":
7575

graph/articles/naming.md

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,61 @@
1-
# Naming
2-
## 1. Approach
1+
# Naming
2+
3+
## 1. Approach
4+
35
Naming policies should aid developers in discovering functionality without having to constantly refer to documentation.
46
Use of common patterns and standard conventions greatly aids developers in correctly guessing common property names and meanings.
57
Services SHOULD use verbose naming patterns and MUST NOT use abbreviations other than acronyms that are the dominant mode of expression in the domain being represented by the API, (e.g. Url).
68

7-
## 2. Casing
9+
## 2. Casing
10+
811
- Acronyms SHOULD follow the casing conventions as though they were regular words (e.g. Url).
912
- All identifiers including namespaces, entityTypes, entitySets, properties, actions, functions and enumeration values MUST use lowerCamelCase.
1013
- HTTP headers are the exception and SHOULD use standard HTTP convention of Capitalized-Hyphenated-Terms.
1114

12-
## 3. Names to avoid
15+
## 3. Names to avoid
16+
1317
Certain names are so overloaded in API domains that they lose all meaning or clash with other common usages in domains that cannot be avoided when using REST APIs, such as OAUTH.
1418
Services SHOULD NOT use the following names:
19+
1520
- Context
1621
- Scope
1722
- Resource
1823

19-
## 4. Forming compound names
24+
## 4. Forming compound names
25+
2026
- Services SHOULD avoid using articles such as 'a', 'the', 'of' unless needed to convey meaning.
21-
- e.g. names such as aUser, theAccount, countOfBooks SHOULD NOT be used, rather user, account, bookCount SHOULD be preferred.
27+
- e.g. names such as aUser, theAccount, countOfBooks SHOULD NOT be used, rather user, account, bookCount SHOULD be preferred.
2228
- Services SHOULD add a type to a property name when not doing so would cause ambiguity about how the data is represented or would cause the service not to use a common property name.
2329
- When adding a type to a property name, services MUST add the type at the end, e.g. createdDateTime.
2430

25-
## 5. Identity properties
31+
## 5. Identity properties
32+
2633
- Services MUST use string types for identity properties.
2734
- For OData services, the service MUST use the OData @id property to represent the canonical identifier of the resource.
2835
- Services MAY use the simple 'id' property to represent a local or legacy primary key value for a resource.
2936
- Services SHOULD use the name of the relationship postfixed with 'Id' to represent a foreign key to another resource, e.g. subscriptionId.
30-
- The content of this property SHOULD be the canonical ID of the referenced resource.
37+
- The content of this property SHOULD be the canonical ID of the referenced resource.
3138

32-
## 6. Date and time properties
39+
## 6. Date and time properties
3340

3441
- For properties requiring both date and time, services MUST use the suffix 'DateTime'.
3542
- For properties requiring only date information without specifying time, services MUST use the suffix 'Date', e.g. birthDate.
3643
- For properties requiring only time information without specifying date, services MUST use the suffix 'Time', e.g. appointmentStartTime.
3744

38-
## 7. Name properties
45+
## 7. Name properties
46+
3947
- For the overall name of a resource typically shown to users, services MUST use the property name 'displayName'.
4048
- Services MAY use other common naming properties, e.g. givenName, surname, signInName.
4149

42-
## 8. Collections and counts
50+
## 8. Collections and counts
51+
4352
- Services MUST name collections as plural nouns or plural noun phrases using correct English.
4453
- Services MAY use simplified English for nouns that have plurals not in common verbal usage.
45-
- e.g. schemas MAY be used instead of schemata.
54+
- e.g. schemas MAY be used instead of schemata.
4655
- Services MUST name counts of resources with a noun or noun phrase suffixed with 'Count'.
4756

48-
## 9. Common property names
57+
## 9. Common property names
58+
4959
Where services have a property, whose data matches the names below, the service MUST use the name from this table.
5060
This table will grow as services add terms that will be more commonly used.
5161
Service owners adding such terms SHOULD propose additions to this document.

0 commit comments

Comments
 (0)