Commit 308a837
authored
clientgen: fix panic when generation openapi with named unions (#2198)
Reported in
https://discord.com/channels/814482502336905216/1445923767015571599/1448428947607130183
```ts
type FooRequest = {
foo: string;
};
type ApiRequest = {
blob: FooRequest | string;
};
export const myApi = api<ApiRequest, void>(
{ expose: true, method: "POST" },
(req) => {},
);
```
Now yields:
```json
{
"schema": {
"properties": {
"blob": {
"anyOf": [
{
"$ref": "#/components/schemas/hello.FooRequest"
},
{
"type": "string"
}
]
}
},
"required": [
"blob"
],
"type": "object"
}
}
```
Possibly also solves #1757 #1521 #18671 parent ca39363 commit 308a837
1 file changed
+4
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
189 | | - | |
| 189 | + | |
190 | 190 | | |
191 | | - | |
| 191 | + | |
192 | 192 | | |
193 | 193 | | |
194 | | - | |
| 194 | + | |
| 195 | + | |
195 | 196 | | |
196 | 197 | | |
197 | 198 | | |
| |||
0 commit comments