A few of our OpenAPI OneOf types contain properties that are of different types. These were not handled properly, as the generator would take the first property type only and set that as the expected type. Sadly this impacted only a single type as the others had been set as string which the JSON decoder happily used. This commit contains a fix for said situation.
Fix
All struct field types that have different property types in the OpenAPI spec have now been set to any.
Manual testing
I have tested manually against a rack by running the following code
Overview
A few of our OpenAPI OneOf types contain properties that are of different types. These were not handled properly, as the generator would take the first property type only and set that as the expected type. Sadly this impacted only a single type as the others had been set as
string
which the JSON decoder happily used. This commit contains a fix for said situation.Fix
All struct field types that have different property types in the OpenAPI spec have now been set to
any
.Manual testing
I have tested manually against a rack by running the following code
The results were as expected
Closes: https://github.com/oxidecomputer/oxide.go/issues/233