Skip to content

Commit 3da126d

Browse files
committed
Reformatting
1 parent 0427742 commit 3da126d

File tree

1 file changed

+21
-14
lines changed

1 file changed

+21
-14
lines changed

README.md

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Introduction
22

3-
# General Guidelines
4-
53
# A Practical REST API Design Method
64

75
## You should think of the API as a product.
@@ -94,7 +92,28 @@ Error code `500`
9492
}
9593
```
9694

95+
# Versioning
96+
97+
Versions should be expressed in the URI of the the API, and should version the API of the service to allow for independent upgrading of services.
98+
99+
```
100+
https://api.cisco.com/<service>/v1/<method>
101+
```
102+
103+
When an API has multiple versions, we recommend two versions should be supported at the same time.
104+
105+
Incrementing versions should only happen when breaking changes are necessary to be introduced in the API. Otherwise, APIs should be backwards compatible as new functionality is introduced. This can be achieved by introducing new values as optional as opposed to required.
106+
107+
# How To Handle Large Results
108+
109+
Some endpoints, such as collections/lists/arrays, will return more results than are wise to send over the network. In these cases, you should implement paging.
110+
111+
Pagination should be implemented using the RFC5988 (Web Linking) standard for pagination. When requesting a list of resources the response may contain a `Link` header containing the URLs to the first, next and previous page.
97112

113+
Page sizes should be requested by including the parameter `page_size`.
114+
115+
116+
**Notes**
98117

99118
# Data
100119

@@ -107,15 +126,3 @@ What encoding should be supported: The majority of new web APIs tend to implemen
107126
# Links
108127

109128
The use of links: Hypermedia APIs have long been considered by many in the industry as being the way to implement data linkages across multiple endpoints or APIs, with identifiers to related data items implemented as links rather than as a simple surrogate or canonical identifier. However, doing so cohesively across an organization demands a singularity of purpose that a style guide can help deliver. Moreover, there are times when including rather than linking to data for the purposes of efficiency is desirable. The style guide therefore needs to define an organizational approach to hypermedia APIs and, where they are being promoted, define practical steps for making them work.
110-
111-
# Versioning
112-
113-
Versions should be expressed in the URI of the the API, and should version the API of the service to allow for independent upgrading of services.
114-
115-
```
116-
https://api.cisco.com/<service>/v1/<method>
117-
```
118-
119-
When an API has multiple versions, we recommend two versions should be supported at the same time.
120-
121-
Incrementing versions should only happen when breaking changes are necessary to be introduced in the API. Otherwise, APIs should be backwards compatible as new functionality is introduced. This can be achieved by introducing new values as optional as opposed to required.

0 commit comments

Comments
 (0)