Commit cfe15f4
committed
test(core): pin optional-by-default requestBody behavior (#2028)
PR #3263 changed packages/core/src/getters/body.ts to treat
`requestBody.required !== true` as optional, fixing the OpenAPI 3.0
optional-by-default behavior reported in #2028. That PR's title and
description don't mention #2028, so the rule isn't traceable from the
issue.
Lock down two specific cases that were not explicitly covered in
body.test.ts:
- The exact shape from #2028: an inline requestBody whose content schema
is a $ref to components/schemas, with no `required` field. This
case fails under the pre-#3263 `required !== undefined` rule and
passes under the current `required !== true` rule.
- A $ref requestBody marked `required: false` (the explicit-false
branch of components/requestBodies).1 parent b059ca6 commit cfe15f4
1 file changed
Lines changed: 65 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
159 | 224 | | |
160 | 225 | | |
161 | 226 | | |
| |||
0 commit comments