Closed karthikr-vti closed 1 year ago
For example following openapi spec would generate results with any instead of ModeA | ModeB for react-query v4
{"openapi":"3.0.2","info":{"title":"Test","version":"0.1.0"},"paths":{"/":{"get":{"summary":"Read Root","operationId":"read_root__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Read Root Get","anyOf":[{"$ref":"#/components/schemas/ModeA"},{"$ref":"#/components/schemas/ModeB"}]}}}}}}}},"components":{"schemas":{"ModeA":{"title":"ModeA","required":["val"],"type":"object","properties":{"val":{"title":"Val","type":"number"}}},"ModeB":{"title":"ModeB","required":["config"],"type":"object","properties":{"config":{"title":"Config","type":"string"}}}}}}
Generated client (truncated): function makeRequests(axios: AxiosInstance, config?: AxiosConfig) { return { readRootGet: () => axios.request<**any**>({ method: "get", url:/ }).then(res => res.data) } as const; }
function makeRequests(axios: AxiosInstance, config?: AxiosConfig) { return { readRootGet: () => axios.request<**any**>({ method: "get", url:
}).then(res => res.data) } as const; }
Thanks for the example file, I will look into this
@karthikr-vti This should be fixed now in version 2.3.0
For example following openapi spec would generate results with any instead of ModeA | ModeB for react-query v4
{"openapi":"3.0.2","info":{"title":"Test","version":"0.1.0"},"paths":{"/":{"get":{"summary":"Read Root","operationId":"read_root__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Read Root Get","anyOf":[{"$ref":"#/components/schemas/ModeA"},{"$ref":"#/components/schemas/ModeB"}]}}}}}}}},"components":{"schemas":{"ModeA":{"title":"ModeA","required":["val"],"type":"object","properties":{"val":{"title":"Val","type":"number"}}},"ModeB":{"title":"ModeB","required":["config"],"type":"object","properties":{"config":{"title":"Config","type":"string"}}}}}}
Generated client (truncated):
function makeRequests(axios: AxiosInstance, config?: AxiosConfig) { return { readRootGet: () => axios.request<**any**>({ method: "get", url:
/}).then(res => res.data) } as const; }