Commit aa785d0
authored
fix: Fix optional params defaulting to __SPEAKEASY_UNSET__ (#99)
See #94 for example. Our api uses `anyOf` for optional params, and if
there's no default value, the client sets the default
__SPEAKEASY_UNSET__. This string gets sent for all optional params and
causes the server to basically always return a validation error.
We need to add a null default like so:
```
"combine_under_n_chars": {
"anyOf": [
{
"type": "integer",
"default": null
},
{
"type": "null"
}
],
},
```
However, doing this on the server breaks the js-client. Over there,
optional params are undefined by default, and adding a null default
causes us to send a literal `null`, causing the same validation issues.
Thus the fix is to set the defaults only on the python side and remove
the workaround on the server.
To test, run `make client-generate && make test`.1 parent 16a29a8 commit aa785d0
1 file changed
+4
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
0 commit comments