Skip to content

Commit fd95566

Browse files
committed
fix: Format
1 parent a3ef3fd commit fd95566

File tree

2 files changed

+45
-4
lines changed

2 files changed

+45
-4
lines changed

tools/spectral/ipa/rulesets/IPA-104.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ rules:
4343
xgen-IPA-104-get-method-response-code-is-200:
4444
description: |
4545
The Get method must return a 200 OK response.
46-
46+
4747
##### Implementation details
4848
Rule checks for the following conditions:
4949
- Applies only to GET methods on single resources or singleton resources
@@ -57,7 +57,7 @@ rules:
5757
xgen-IPA-104-get-method-returns-response-suffixed-object:
5858
description: |
5959
The Get method of a resource should return a "Response" suffixed object.
60-
60+
6161
##### Implementation details
6262
Rule checks for the following conditions:
6363
- Applies only to 2xx responses of GET methods on single resources or singleton resources
@@ -72,7 +72,7 @@ rules:
7272
xgen-IPA-104-get-method-response-has-no-input-fields:
7373
description: |
7474
The Get method response object must not include writeOnly properties (fields that should be used only on creation or update, ie output fields).
75-
75+
7676
##### Implementation details
7777
Rule checks for the following conditions:
7878
- Applies only to 2xx responses of GET methods on single resources or singleton resources
@@ -87,7 +87,7 @@ rules:
8787
xgen-IPA-104-get-method-no-request-body:
8888
description: |
8989
The Get method request must not include a body.
90-
90+
9191
##### Implementation details
9292
Rule checks for the following conditions:
9393
- Applies only to GET methods on single resources or singleton resources

tools/spectral/ipa/rulesets/README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,27 +82,68 @@ Rule is based on [http://go/ipa/IPA-104](http://go/ipa/IPA-104).
8282

8383
![warn](https://img.shields.io/badge/warning-yellow)
8484
APIs must provide a Get method for resources.
85+
86+
##### Implementation details
87+
Rule checks for the following conditions:
88+
- Only applies to resource collection identifiers
89+
- For singleton resources, verifies the resource has a GET method
90+
- For regular resources, verifies there is a single resource path with a GET method
91+
8592
#### xgen-IPA-104-get-method-returns-single-resource
8693

8794
![warn](https://img.shields.io/badge/warning-yellow)
8895
The purpose of the Get method is to return data from a single resource.
96+
97+
##### Implementation details
98+
Rule checks for the following conditions:
99+
- Applies only to 2xx responses of GET methods on single resources or singleton resources
100+
- Verifies the response is not an array or paginated result
101+
- Different error messages are provided for standard vs singleton resources
102+
89103
#### xgen-IPA-104-get-method-response-code-is-200
90104

91105
![warn](https://img.shields.io/badge/warning-yellow)
92106
The Get method must return a 200 OK response.
107+
108+
##### Implementation details
109+
Rule checks for the following conditions:
110+
- Applies only to GET methods on single resources or singleton resources
111+
- Verifies the 200 OK response code is present
112+
- Fails if the method lacks a 200 OK response or defines a different 2xx status code
113+
93114
#### xgen-IPA-104-get-method-returns-response-suffixed-object
94115

95116
![warn](https://img.shields.io/badge/warning-yellow)
96117
The Get method of a resource should return a "Response" suffixed object.
118+
119+
##### Implementation details
120+
Rule checks for the following conditions:
121+
- Applies only to 2xx responses of GET methods on single resources or singleton resources
122+
- Verifies the schema references a predefined schema (not inline)
123+
- Confirms the referenced schema name ends with "Response" suffix
124+
97125
#### xgen-IPA-104-get-method-response-has-no-input-fields
98126

99127
![warn](https://img.shields.io/badge/warning-yellow)
100128
The Get method response object must not include writeOnly properties (fields that should be used only on creation or update, ie output fields).
129+
130+
##### Implementation details
131+
Rule checks for the following conditions:
132+
- Applies only to 2xx responses of GET methods on single resources or singleton resources
133+
- Searches through the schema to find any properties marked with writeOnly attribute
134+
- Fails if any writeOnly properties are found in the response schema
135+
101136
#### xgen-IPA-104-get-method-no-request-body
102137

103138
![warn](https://img.shields.io/badge/warning-yellow)
104139
The Get method request must not include a body.
105140

141+
##### Implementation details
142+
Rule checks for the following conditions:
143+
- Applies only to GET methods on single resources or singleton resources
144+
- Verifies that the operation object does not contain a requestBody property
145+
146+
106147

107148
### IPA-105
108149

0 commit comments

Comments
 (0)