Repository navigation
Commit 7a3905f
[java][okhttp] Handle JSON-B parents without a discriminator
A model with children but no discriminator (x-parent, or a single allOf
$ref) got neither the leaf (de)serializers, which skip every model with
children, nor the hierarchy-root ones, which required a discriminator. It
fell back to plain bean mapping and lost its required-field checks and
additionalProperties. The root (de)serializers now cover every parent; with
no discriminator the deserializer binds the root itself. Subtypes still
delegate to the polymorphism-free instance, so Yasson's superclass lookup
cannot narrow them to the parent. No sample defines such a parent.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>1 parent 6a7029a commit 7a3905f
3 files changed
Lines changed: 24 additions & 6 deletions
File tree
- modules/openapi-generator/src
- main/resources/Java/libraries/okhttp
- test/java/org/openapitools/codegen/java
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
784 | 784 | | |
785 | 785 | | |
786 | 786 | | |
787 | | - | |
788 | 787 | | |
789 | 788 | | |
790 | | - | |
791 | 789 | | |
792 | 790 | | |
793 | 791 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | 34 | | |
36 | 35 | | |
37 | 36 | | |
| |||
41 | 40 | | |
42 | 41 | | |
43 | 42 | | |
44 | | - | |
45 | 43 | | |
46 | 44 | | |
47 | 45 | | |
| |||
788 | 786 | | |
789 | 787 | | |
790 | 788 | | |
791 | | - | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
792 | 793 | | |
793 | 794 | | |
794 | 795 | | |
| |||
886 | 887 | | |
887 | 888 | | |
888 | 889 | | |
| 890 | + | |
889 | 891 | | |
| 892 | + | |
890 | 893 | | |
891 | 894 | | |
892 | 895 | | |
| |||
960 | 963 | | |
961 | 964 | | |
962 | 965 | | |
963 | | - | |
964 | 966 | | |
965 | 967 | | |
966 | 968 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5739 | 5739 | | |
5740 | 5740 | | |
5741 | 5741 | | |
| 5742 | + | |
| 5743 | + | |
| 5744 | + | |
| 5745 | + | |
| 5746 | + | |
| 5747 | + | |
| 5748 | + | |
| 5749 | + | |
| 5750 | + | |
| 5751 | + | |
| 5752 | + | |
| 5753 | + | |
| 5754 | + | |
| 5755 | + | |
| 5756 | + | |
| 5757 | + | |
| 5758 | + | |
| 5759 | + | |
5742 | 5760 | | |
5743 | 5761 | | |
5744 | 5762 | | |
| |||
0 commit comments