Commit 634b7eb
authored
Fix empty additionalProperties dictionary encoding (#103)
### Motivation
Fixes apple/swift-openapi-generator#525.
Turns out that the mere act of creating a decoding container is
meaningful and we skipped it as an optimization, causing JSONDecoder to
fail for empty dictionaries when used in additional properties.
### Modifications
Remove the extra guards that skipped creating a container, even when we
already know there are no elements.
### Result
No more failures when encoding empty dictionaries in
additionalProperties.
### Test Plan
Tested manually as this requirement seems to be coming out of
JSONDecoder.1 parent a875c2d commit 634b7eb
1 file changed
+0
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
106 | 105 | | |
107 | 106 | | |
108 | 107 | | |
| |||
116 | 115 | | |
117 | 116 | | |
118 | 117 | | |
119 | | - | |
120 | 118 | | |
121 | 119 | | |
122 | 120 | | |
| |||
0 commit comments