Commit 96fb53b
committed
protoc-gen-openapi: remove duplicate body params
When a request has both path parameters and body = "*", the path
parameters were being repeated in the body. But according to the docs:
the special name `*` is used to define that every field not bound by the
path template should be mapped to the request body.
This commit does exactly that, when the body is `*` and there are some
path parameters, then the a new message schema is created that does not
include the path parameters. The name of the schema is the same as the
message name, with the `_Body` suffix.
fixes #3231 parent ad271d5 commit 96fb53b
File tree
45 files changed
+1756
-227
lines changed- cmd/protoc-gen-openapi
- examples
- google/example/library/v1
- tests
- additional_bindings
- allofwrap
- mapfields
- noannotations
- openapiv3annotations
- pathparams
- protobuftypes
- generator
- metrics
- plugins
- surface
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
45 files changed
+1756
-227
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
Lines changed: 6 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
335 | 335 | | |
336 | 336 | | |
337 | 337 | | |
338 | | - | |
| 338 | + | |
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
| |||
374 | 374 | | |
375 | 375 | | |
376 | 376 | | |
377 | | - | |
| 377 | + | |
378 | 378 | | |
379 | 379 | | |
380 | 380 | | |
| |||
469 | 469 | | |
470 | 470 | | |
471 | 471 | | |
472 | | - | |
| 472 | + | |
473 | 473 | | |
474 | | - | |
475 | 474 | | |
476 | 475 | | |
477 | 476 | | |
478 | | - | |
479 | | - | |
480 | | - | |
481 | 477 | | |
482 | 478 | | |
483 | 479 | | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
| 480 | + | |
| 481 | + | |
488 | 482 | | |
489 | | - | |
490 | 483 | | |
491 | 484 | | |
492 | 485 | | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | 486 | | |
497 | 487 | | |
498 | 488 | | |
499 | | - | |
500 | | - | |
501 | | - | |
| 489 | + | |
502 | 490 | | |
503 | 491 | | |
504 | 492 | | |
| |||
Lines changed: 6 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
335 | 335 | | |
336 | 336 | | |
337 | 337 | | |
338 | | - | |
| 338 | + | |
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
| |||
374 | 374 | | |
375 | 375 | | |
376 | 376 | | |
377 | | - | |
| 377 | + | |
378 | 378 | | |
379 | 379 | | |
380 | 380 | | |
| |||
469 | 469 | | |
470 | 470 | | |
471 | 471 | | |
472 | | - | |
| 472 | + | |
473 | 473 | | |
474 | | - | |
475 | 474 | | |
476 | 475 | | |
477 | 476 | | |
478 | | - | |
479 | | - | |
480 | | - | |
481 | 477 | | |
482 | 478 | | |
483 | 479 | | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
| 480 | + | |
| 481 | + | |
488 | 482 | | |
489 | | - | |
490 | 483 | | |
491 | 484 | | |
492 | 485 | | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | 486 | | |
497 | 487 | | |
498 | 488 | | |
499 | | - | |
500 | | - | |
501 | | - | |
| 489 | + | |
502 | 490 | | |
503 | 491 | | |
504 | 492 | | |
| |||
Lines changed: 6 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
335 | 335 | | |
336 | 336 | | |
337 | 337 | | |
338 | | - | |
| 338 | + | |
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
| |||
374 | 374 | | |
375 | 375 | | |
376 | 376 | | |
377 | | - | |
| 377 | + | |
378 | 378 | | |
379 | 379 | | |
380 | 380 | | |
| |||
461 | 461 | | |
462 | 462 | | |
463 | 463 | | |
464 | | - | |
| 464 | + | |
465 | 465 | | |
466 | | - | |
467 | 466 | | |
468 | 467 | | |
469 | 468 | | |
470 | | - | |
471 | | - | |
472 | | - | |
473 | 469 | | |
474 | 470 | | |
475 | 471 | | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | | - | |
| 472 | + | |
| 473 | + | |
480 | 474 | | |
481 | | - | |
482 | 475 | | |
483 | 476 | | |
484 | 477 | | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | 478 | | |
489 | 479 | | |
490 | 480 | | |
491 | | - | |
492 | | - | |
493 | | - | |
| 481 | + | |
494 | 482 | | |
495 | 483 | | |
496 | 484 | | |
| |||
Lines changed: 6 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
335 | 335 | | |
336 | 336 | | |
337 | 337 | | |
338 | | - | |
| 338 | + | |
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
| |||
374 | 374 | | |
375 | 375 | | |
376 | 376 | | |
377 | | - | |
| 377 | + | |
378 | 378 | | |
379 | 379 | | |
380 | 380 | | |
| |||
469 | 469 | | |
470 | 470 | | |
471 | 471 | | |
472 | | - | |
| 472 | + | |
473 | 473 | | |
474 | | - | |
475 | 474 | | |
476 | 475 | | |
477 | 476 | | |
478 | | - | |
479 | | - | |
480 | | - | |
481 | 477 | | |
482 | 478 | | |
483 | 479 | | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
| 480 | + | |
| 481 | + | |
488 | 482 | | |
489 | | - | |
490 | 483 | | |
491 | 484 | | |
492 | 485 | | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | 486 | | |
497 | 487 | | |
498 | 488 | | |
499 | | - | |
500 | | - | |
501 | | - | |
| 489 | + | |
502 | 490 | | |
503 | 491 | | |
504 | 492 | | |
| |||
Lines changed: 6 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
335 | 335 | | |
336 | 336 | | |
337 | 337 | | |
338 | | - | |
| 338 | + | |
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
| |||
374 | 374 | | |
375 | 375 | | |
376 | 376 | | |
377 | | - | |
| 377 | + | |
378 | 378 | | |
379 | 379 | | |
380 | 380 | | |
| |||
469 | 469 | | |
470 | 470 | | |
471 | 471 | | |
472 | | - | |
| 472 | + | |
473 | 473 | | |
474 | | - | |
475 | 474 | | |
476 | 475 | | |
477 | 476 | | |
478 | | - | |
479 | | - | |
480 | | - | |
481 | 477 | | |
482 | 478 | | |
483 | 479 | | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
| 480 | + | |
| 481 | + | |
488 | 482 | | |
489 | | - | |
490 | 483 | | |
491 | 484 | | |
492 | 485 | | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | 486 | | |
497 | 487 | | |
498 | 488 | | |
499 | | - | |
500 | | - | |
501 | | - | |
| 489 | + | |
502 | 490 | | |
503 | 491 | | |
504 | 492 | | |
| |||
0 commit comments