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
Copy file name to clipboardExpand all lines: documentation/swagger-checklist.md
+35-21Lines changed: 35 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,58 +58,72 @@ Where "M" stands for 'MUST' or 'MUST NOT' requirement. "S" stands for 'SHOULD' o
58
58
59
59
## Naming - Swagger Checklist ##
60
60
61
-
▢*M1000*: Plural names MUST only be used to represent collections.
61
+
-[ ]*M1000*: Plural names in parameters and model properties MUST only be used to represent collections.
62
62
63
-
▢*M1001*: List operations MUST be prefixed with "List" and MUST not be named as "GetXXXX" operations.
63
+
-[ ]*M1001*: Each operation must contain an OperationId of the form "RESOURCE_METHOD" where "RESOURCE" represents the resource or object the operation addresses, and METHOD is a short name for the operation being performed "Get, Start, Remove", etc.
64
64
65
-
▢*M1002*: List operations MUST use consistent names and semantics. List operations MUST NOT use any other names. Consistent names and semantics are:
65
+
-[ ]*M1002*: List operations MUST use the METHOD prefix "List" and MUST not be named as "GetXXXX" operations.
66
66
67
-
-`List()` - lists all resources under a subscription.
68
-
-`ListByResourceGroup()` - list all resources in a resource group within a subscription.
69
-
-`ListByParent()` - where "Parent" is a context specific suffix. It lists all resource under a parent.
67
+
-[ ]*M1003*: List operations MUST use consistent names and semantics. List operations MUST NOT use any other names. Consistent names and semantics are:
68
+
-`List()` - lists all resources under a subscription.
69
+
-`ListByResourceGroup()` - list all resources in a resource group within a subscription.
70
+
-`ListByParent()` - where "Parent" is a context specific suffix. It lists all resource under a parent.
71
+
72
+
-[ ]*M1006*: Get operations MUST use the METHOD name "Get"
70
73
71
-
▢*M1003*: Terminology in Swagger and Azure Portal MUST be the same.
74
+
-[ ]*M1007*: PUT operations MUST use the METHOD Name "Create"
75
+
76
+
-[ ]*M1008*: PATCH operations MUST use the METHOD Name "Update"
77
+
78
+
-[ ]*M1008*: POST operations MUST use a METHOD Name that matches the semantic operation on the resource, for example "Start" or "Stop"
79
+
80
+
-[ ]*M1009*: DELETE operations MUST use the METHOD Name "Delete"
81
+
82
+
-[ ]*M1010*: Terminology in Swagger and Azure Portal MUST be the same. Property names must match proeprty names as displayed in the portal. Paremeter names musst match value names displayed in the poral.
72
83
73
84
74
85
75
86
## Operation Semantics - Swagger Checklist ##
76
87
77
-
▢*M2000*: A Swagger specification MUST be accompanied with a document that describes management scenarios that can be realized using operations described in the Swagger.
88
+
-[ ]*M2000*: A Swagger specification MUST be accompanied with a document that describes management scenarios that can be realized using operations described in the Swagger.
78
89
79
-
▢*M2001*: Read only parameters MUST be labeled as read only in Swagger.
90
+
-[ ]*M2001*: Read only parameters and model properties MUST be labeled as read only in Swagger.
80
91
81
-
▢*M2002*: Boolean parameters MUST be represented as boolean in Swagger. Boolean parameters MUST NOT be represented as strings. Similarly, this requirements applies to other primitive data types such as integer, float and double. These primitive data types MUST be represented using [Swagger primitive data types](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types).
92
+
-[ ]*M2002*: Boolean parameters MUST be represented as boolean in Swagger. Boolean parameters MUST NOT be represented as strings. Similarly, this requirements applies to other primitive data types such as integer, float and double. These primitive data types MUST be represented using [Swagger primitive data types](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types).
82
93
83
-
▢*M2003*: Long running operations MUST be modeled as [long running operations](https://github.com/Azure/azure-rest-api-specs/blob/master/documentation/creating-swagger.md#longrunning) in Swagger.
94
+
-[ ]*M2003*: Long running operations MUST be modeled as [long running operations](https://github.com/Azure/azure-rest-api-specs/blob/master/documentation/creating-swagger.md#longrunning) in Swagger.
84
95
85
-
▢*M2004*: Required parameters MUST be labeled as required in Swagger.
96
+
-[ ]*M2004*: Required parameters MUST be labeled as required in Swagger.
86
97
87
-
▢*M2005*: A collection of references that are read only MUST be marked as read only in Swagger.
98
+
-[ ]*M2005*: A collection of references that are read only MUST be marked as read only in Swagger.
88
99
89
-
▢*M2006*: Mutability of properties MUST be marked up using [`x-ms-mutability` extension](https://github.com/Azure/autorest/tree/master/docs/extensions#x-ms-mutability).
100
+
-[ ]*M2006*: Mutability of properties MUST be marked up using [`x-ms-mutability` extension](https://github.com/Azure/autorest/tree/master/docs/extensions#x-ms-mutability).
90
101
91
-
▢*M2007*: Error definitions MUST be abstracted, modeled and reused instead of introducing a plethora of error definitions that look the same with different names.
102
+
-[ ]*M2007*: Error definitions MUST be abstracted, modeled and reused instead of introducing a plethora of error definitions that look the same with different names.
92
103
93
-
▢*M2008*: A Swagger spec MUST NOT define operations or properties or parameters for functionalities that MAY work in the future.
104
+
-[ ]*M2008*: A Swagger spec MUST NOT define operations or properties or parameters for functionalities that MAY work in the future.
94
105
95
106
For example, `OutBoundNATRule` is a model that exists in a the networking Swagger but it is not supported by the Networking RP.
96
107
97
-
▢*M2009*: A collection model in Swagger MUST support adding more than one element to the collection.
108
+
-[ ]*M2009*: A collection model in Swagger MUST support adding more than one element to the collection.
109
+
110
+
-[ ]*M2010*: Operations that are exposed through private previews MUST not be described in Swaggers in the [public GitHub repository](https://github.com/Azure/azure-rest-api-specs).
111
+
98
112
99
-
▢*M2010*: Operations that are exposed through private previews MUST not be described in Swaggers in the [public GitHub repository](https://github.com/Azure/azure-rest-api-specs).
113
+
-[ ]*M2012*:
100
114
101
115
102
116
## Operational - Swagger Checklist ##
103
117
104
-
▢*M3000*: Swagger authoring MUST NOT be assigned to engineers who do not have an intimate knowledge of a service endpoint and its developer experience to avoid feeding inefficiencies into teams that focus on Azure developer experiences and the rest of the Azure eco system.
118
+
-[ ]*M3000*: Swagger authoring MUST NOT be assigned to engineers who do not have an intimate knowledge of a service endpoint and its developer experience to avoid feeding inefficiencies into teams that focus on Azure developer experiences and the rest of the Azure eco system.
105
119
106
120
For example, if Swagger authoring were assigned to new hires or vendors it would feed inefficiencies into downstream consumption and developer experiences.
107
121
108
-
▢*M3001*: Each operation described in a Swagger specification MUST be tested prior to opening a pull request against the preview branch of the [Azure REST API Specs](https://github.com/azure/azure-rest-api-specs/) GitHub repo.
122
+
-[ ]*M3001*: Each operation described in a Swagger specification MUST be tested prior to opening a pull request against the preview branch of the [Azure REST API Specs](https://github.com/azure/azure-rest-api-specs/) GitHub repo.
109
123
110
124
## Documentation - Swagger Checklist ##
111
125
112
-
▢*M4000*: Descriptions MUST NOT contain spelling errors, grammatical errors, run off sentences and dummy texts.
126
+
-[ ]*M4000*: Descriptions MUST NOT contain spelling errors, grammatical errors, run off sentences and dummy texts.
113
127
114
128
Here are some [basic rules for public documentation](https://github.com/Azure/azure-rest-api-specs/blob/master/documentation/swagger-authoring-descriptions.md#basic-rules-for-public-docs-descriptions):
0 commit comments