Commit 5dd0da1
authored
Disable OpenAPIKit parameterStyleAndLocationAreCompatible validator (#903)
### Motivation
After updating to OpenAPIKit 6.0 (#875), the generator fails on OpenAPI
documents that use `style: simple` on query parameters. While this is
technically invalid per the OpenAPI specification, it was previously
tolerated -- the generator would skip the unsupported parameter with a
warning diagnostic and continue generation.
The new OpenAPIKit 6.0 brings a new default built-in validation
(`.parameterStyleAndLocationAreCompatible`) that rejects documents with
this combination at validation time. Because this fires as a validation
error (not a warning), it is thrown even with `strict: false`, before
the translator gets a chance to handle the parameter gracefully.
This is a regression for users with documents that have this common spec
violation, which we do have examples of in our extended compatibility
test suite).
### Modifications
Replace the use of `Validator()` (which includes all OpenAPIKit
defaults) with a custom validator built from `Validator.blank`. This
explicitly lists all default validations from OpenAPIKit 6.0.0 except
`.parameterStyleAndLocationAreCompatible`, restoring the previous
behaviour where the generator tolerates these documents.
We might want to revisit how lenient we are for this, but this patch is
the most expeditious way to getting a release out with the OpenAPIKit
update.
### Result
Documents with `style: simple` on query parameters are no longer
rejected at validation time. The translator continues to emit an
"unsupported" diagnostic and skip the parameter, as it did before the
OpenAPIKit upgrade:
```
'Feature "Query params of style simple, explode: false" is not supported, skipping'
```1 parent d154389 commit 5dd0da1
2 files changed
Lines changed: 57 additions & 1 deletion
File tree
- Sources/_OpenAPIGeneratorCore/Parser
- Tests/OpenAPIGeneratorCoreTests/Parser
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
303 | 303 | | |
304 | 304 | | |
305 | 305 | | |
306 | | - | |
| 306 | + | |
307 | 307 | | |
308 | 308 | | |
309 | 309 | | |
| |||
315 | 315 | | |
316 | 316 | | |
317 | 317 | | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
Lines changed: 32 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
480 | 480 | | |
481 | 481 | | |
482 | 482 | | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
483 | 515 | | |
484 | 516 | | |
485 | 517 | | |
| |||
0 commit comments