Skip to content

Commit 5165f2b

Browse files
authored
Merge pull request #1 from markcowl/patch-1
Some small suggested chenges to thw checklist
2 parents bc1f41b + 43db911 commit 5165f2b

1 file changed

Lines changed: 35 additions & 21 deletions

File tree

documentation/swagger-checklist.md

Lines changed: 35 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -58,58 +58,72 @@ Where "M" stands for 'MUST' or 'MUST NOT' requirement. "S" stands for 'SHOULD' o
5858

5959
## Naming - Swagger Checklist ##
6060

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.
6262

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.
6464

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.
6666

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"
7073

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.
7283

7384

7485

7586
## Operation Semantics - Swagger Checklist ##
7687

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.
7889

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.
8091

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).
8293

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.
8495

85-
▢ *M2004*: Required parameters MUST be labeled as required in Swagger.
96+
- [ ] *M2004*: Required parameters MUST be labeled as required in Swagger.
8697

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.
8899

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).
90101

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.
92103

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.
94105

95106
For example, `OutBoundNATRule` is a model that exists in a the networking Swagger but it is not supported by the Networking RP.
96107

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+
98112

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*:
100114

101115

102116
## Operational - Swagger Checklist ##
103117

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.
105119

106120
For example, if Swagger authoring were assigned to new hires or vendors it would feed inefficiencies into downstream consumption and developer experiences.
107121

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.
109123

110124
## Documentation - Swagger Checklist ##
111125

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.
113127

114128
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):
115129

0 commit comments

Comments
 (0)