Skip to content

Commit 0524131

Browse files
committed
Use code casing
1 parent 845a20f commit 0524131

File tree

2 files changed

+40
-42
lines changed

2 files changed

+40
-42
lines changed

azure/ConsiderationsForServiceDesign.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ An important consideration when defining a new service is support for pagination
9494
Another consideration for collections is support for sorting the set of returned items with the _orderby_ query parameter.
9595
Sorting collection results can be extremely expensive for a service to implement as it must retrieve all items to sort them. And if the operation supports paging (which is likely), then a client request to get another page may have to retrieve all items and sort them again to determine which items are on the desired page.
9696

97-
:heavy_check_mark: **YOU MAY** support _orderby_ if customer scenarios really demand it and the service is confident that it can support it in perpetuity (even if the backing storage service changes someday).
97+
:heavy_check_mark: **YOU MAY** support `orderby` if customer scenarios really demand it and the service is confident that it can support it in perpetuity (even if the backing storage service changes someday).
9898

9999
Another important design pattern for avoiding surprises is idempotency. An operation is idempotent if it can be performed multiple times and have the same result as a single execution.
100100
HTTP requires certain operations like GET, PUT, and DELETE to be idempotent, but for cloud services it is important to make _all_ operations idempotent so that clients can use retry in failure scenarios without risk of unintended consequences.

azure/Guidelines.md

Lines changed: 39 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -462,41 +462,41 @@ Note: To avoid potential collision of actions and resource ids, you should disal
462462

463463
Parameter name | Type | Description
464464
------------------- | ---- | -----------
465-
_filter_ | string | an expression on the resource type that selects the resources to be returned
466-
_orderby_ | string array | a list of expressions that specify the order of the returned resources
467-
_skip_ | integer | an offset into the collection of the first resource to be returned
468-
_top_ | integer | the maximum number of resources to return from the collection
469-
_maxpagesize_ | integer | the maximum number of resources to include in a single response
470-
_select_ | string array | a list of field names to be returned for each resource
471-
_expand_ | string array | a list of the related resources to be included in line with each resource
465+
`filter` | string | an expression on the resource type that selects the resources to be returned
466+
`orderby` | string array | a list of expressions that specify the order of the returned resources
467+
`skip` | integer | an offset into the collection of the first resource to be returned
468+
`top` | integer | the maximum number of resources to return from the collection
469+
`maxpagesize` | integer | the maximum number of resources to include in a single response
470+
`select` | string array | a list of field names to be returned for each resource
471+
`expand` | string array | a list of the related resources to be included in line with each resource
472472

473473
:white_check_mark: **DO** return an error if the client specifies any parameter not supported by the service.
474474

475475
:white_check_mark: **DO** treat these query parameter names as case-sensitive.
476476

477-
:white_check_mark: **DO** apply _select_ or _expand_ options after applying all the query options in the table above.
477+
:white_check_mark: **DO** apply `select` or `expand` options after applying all the query options in the table above.
478478

479479
:white_check_mark: **DO** apply the query options to the collection in the order shown in the table above.
480480

481481
:no_entry: **DO NOT** prefix any of these query parameter names with "$" (the convention in the [OData standard](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_QueryingCollections)).
482482

483-
#### filter
483+
#### `filter`
484484

485-
:heavy_check_mark: **YOU MAY** support filtering of the results of a list operation with the _filter_ query parameter.
485+
:heavy_check_mark: **YOU MAY** support `filter`ing of the results of a list operation with the `filter` query parameter.
486486

487-
The value of the _filter_ option is an expression involving the fields of the resource that produces a Boolean value. This expression is evaluated for each resource in the collection and only items where the expression evaluates to true are included in the response.
487+
The value of the `filter` option is an expression involving the fields of the resource that produces a Boolean value. This expression is evaluated for each resource in the collection and only items where the expression evaluates to true are included in the response.
488488

489-
:white_check_mark: **DO** omit all resources from the collection for which the _filter_ expression evaluates to false or to null, or references properties that are unavailable due to permissions.
489+
:white_check_mark: **DO** omit all resources from the collection for which the `filter` expression evaluates to false or to null, or references properties that are unavailable due to permissions.
490490

491491
Example: return all Products whose Price is less than $10.00
492492

493493
```http
494-
GET https://api.contoso.com/products?filter=price lt 10.00
494+
GET https://api.contoso.com/products?`filter`=price lt 10.00
495495
```
496496

497-
##### filter operators
497+
##### `filter` operators
498498

499-
:heavy_check_mark: **YOU MAY** support the following operators in _filter_ expressions:
499+
:heavy_check_mark: **YOU MAY** support the following operators in `filter` expressions:
500500

501501
Operator | Description | Example
502502
-------------------- | --------------------- | -----------------------------------------------------
@@ -514,9 +514,9 @@ not | Logical negation | not price le 3.5
514514
**Grouping Operators** | |
515515
( ) | Precedence grouping | (priority eq 1 or city eq 'Redmond') and price gt 100
516516

517-
:white_check_mark: **DO** respond with an error message as defined in the [Handling Errors](handling-errors) section if a client includes an operator in a _filter_ expression that is not supported by the operation.
517+
:white_check_mark: **DO** respond with an error message as defined in the [Handling Errors](handling-errors) section if a client includes an operator in a `filter` expression that is not supported by the operation.
518518

519-
:white_check_mark: **DO** use the following operator precedence for supported operators when evaluating _filter_ expressions. Operators are listed by category in order of precedence from highest to lowest. Operators in the same category have equal precedence and should be evaluated left to right:
519+
:white_check_mark: **DO** use the following operator precedence for supported operators when evaluating `filter` expressions. Operators are listed by category in order of precedence from highest to lowest. Operators in the same category have equal precedence and should be evaluated left to right:
520520

521521
| Group | Operator | Description
522522
| ----------------|----------|------------
@@ -531,50 +531,50 @@ not | Logical negation | not price le 3.5
531531
| Conditional AND | and | Logical And |
532532
| Conditional OR | or | Logical Or |
533533

534-
> :heavy_check_mark: **YOU MAY** support orderby and filter functions such as concat and contains. For more information, see [odata Canonical Functions](https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part2-url-conventions.html#_Toc31360979).
534+
> :heavy_check_mark: **YOU MAY** support orderby and `filter` functions such as concat and contains. For more information, see [odata Canonical Functions](https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part2-url-conventions.html#_Toc31360979).
535535
536536
##### Operator examples
537537
The following examples illustrate the use and semantics of each of the logical operators.
538538

539539
Example: all products with a name equal to 'Milk'
540540

541541
```http
542-
GET https://api.contoso.com/products?filter=name eq 'Milk'
542+
GET https://api.contoso.com/products?`filter`=name eq 'Milk'
543543
```
544544

545545
Example: all products with a name not equal to 'Milk'
546546

547547
```http
548-
GET https://api.contoso.com/products?filter=name ne 'Milk'
548+
GET https://api.contoso.com/products?`filter`=name ne 'Milk'
549549
```
550550

551551
Example: all products with the name 'Milk' that also have a price less than 2.55:
552552

553553
```http
554-
GET https://api.contoso.com/products?filter=name eq 'Milk' and price lt 2.55
554+
GET https://api.contoso.com/products?`filter`=name eq 'Milk' and price lt 2.55
555555
```
556556

557557
Example: all products that either have the name 'Milk' or have a price less than 2.55:
558558

559559
```http
560-
GET https://api.contoso.com/products?filter=name eq 'Milk' or price lt 2.55
560+
GET https://api.contoso.com/products?`filter`=name eq 'Milk' or price lt 2.55
561561
```
562562

563563
Example: all products that have the name 'Milk' or 'Eggs' and have a price less than 2.55:
564564

565565
```http
566-
GET https://api.contoso.com/products?filter=(name eq 'Milk' or name eq 'Eggs') and price lt 2.55
566+
GET https://api.contoso.com/products?`filter`=(name eq 'Milk' or name eq 'Eggs') and price lt 2.55
567567
```
568568

569569
#### orderby
570570

571-
:heavy_check_mark: **YOU MAY** support sorting of the results of a list operation with the _orderby_ query parameter.
572-
*NOTE: It is unusual for a service to support _orderby_ because it is very expensive to implement as it requires sorting the entire large collection before being able to return any results.*
571+
:heavy_check_mark: **YOU MAY** support sorting of the results of a list operation with the `orderby` query parameter.
572+
*NOTE: It is unusual for a service to support `orderby` because it is very expensive to implement as it requires sorting the entire large collection before being able to return any results.*
573573

574-
The value of the _orderby_ parameter is a comma-separated list of expressions used to sort the items.
574+
The value of the `orderby` parameter is a comma-separated list of expressions used to sort the items.
575575
A special case of such an expression is a property path terminating on a primitive property.
576576

577-
Each expression in the _orderby_ parameter value may include the suffix "asc" for ascending or "desc" for descending, separated from the expression by one or more spaces.
577+
Each expression in the `orderby` parameter value may include the suffix "asc" for ascending or "desc" for descending, separated from the expression by one or more spaces.
578578

579579
:white_check_mark: **DO** sort the collection in ascending order on an expression if "asc" or "desc" is not specified.
580580

@@ -596,38 +596,36 @@ For example, to return all people sorted by name in descending order and a secon
596596
GET https://api.contoso.com/people?orderby=name desc,hireDate
597597
```
598598

599-
Sorting MUST compose with filtering such that:
599+
Sorting MUST compose with `filter`ing such that:
600600
```http
601-
GET https://api.contoso.com/people?filter=name eq 'david'&orderby=hireDate
601+
GET https://api.contoso.com/people?`filter`=name eq 'david'&orderby=hireDate
602602
```
603603
will return all people whose name is David sorted in ascending order by hireDate.
604604

605605
##### Considerations for sorting with pagination
606606

607-
:white_check_mark: **DO** use the same filtering options and sort order for all pages of a paginated list operation response.
607+
:white_check_mark: **DO** use the same `filter`ing options and sort order for all pages of a paginated list operation response.
608608

609609
##### skip
610-
:white_check_mark: **DO** define the _skip_ parameter as an integer with a default and minimum value of 0.
610+
:white_check_mark: **DO** define the `skip` parameter as an integer with a default and minimum value of 0.
611611

612-
:heavy_check_mark: **YOU MAY** allow clients to pass the _skip_ query parameter to specify an offset into collection of the first resource to be returned.
612+
:heavy_check_mark: **YOU MAY** allow clients to pass the `skip` query parameter to specify an offset into collection of the first resource to be returned.
613613
##### top
614614

615-
:heavy_check_mark: **YOU MAY** allow clients to pass the _top_ query parameter to specify the maximum number of resources to return from the collection.
615+
:heavy_check_mark: **YOU MAY** allow clients to pass the `top` query parameter to specify the maximum number of resources to return from the collection.
616616

617-
If supporting _top_:
618-
:white_check_mark: **DO** define the _top_ parameter as an integer with a minimum value of 1. If not specified, _top_ has a default value of infinity.
617+
If supporting `top`:
618+
:white_check_mark: **DO** define the `top` parameter as an integer with a minimum value of 1. If not specified, `top` has a default value of infinity.
619619

620-
:white_check_mark: **DO** return the collection's _top_ number of resources (if available), starting from _skip_.
620+
:white_check_mark: **DO** return the collection's `top` number of resources (if available), starting from `skip`.
621621

622622
##### maxpagesize
623623

624-
:heavy_check_mark: **YOU MAY** allow clients to pass the _maxpagesize_ query parameter to specify the maximum number of resources to include in a single page response.
624+
:heavy_check_mark: **YOU MAY** allow clients to pass the `maxpagesize` query parameter to specify the maximum number of resources to include in a single page response.
625625

626-
If supporting _maxpagesize_
626+
:white_check_mark: **DO** define the `maxpagesize` parameter as an optional integer with a default value appropriate for the collection.
627627

628-
:white_check_mark: **DO** define the _maxpagesize_ parameter as an optional integer with a default value appropriate for the collection.
629-
630-
:white_check_mark: **DO** make clear in documentation of the _maxpagesize_ parameter that the operation may choose to return fewer resources than the value specified.
628+
:white_check_mark: **DO** make clear in documentation of the `maxpagesize` parameter that the operation may choose to return fewer resources than the value specified.
631629

632630
### API Versioning
633631

0 commit comments

Comments
 (0)