Open njbair opened 1 month ago
Given the minimal example YAML below, note how the generated schema includes response: unknown. After some testing, I determined this only happens when the content type is '*/*'. If I change it to application/json, it works fine.
response: unknown
'*/*'
application/json
openapi: 3.0.3 info: title: Test API Spec version: 1.0.0 components: schemas: Response: properties: id: type: integer name: type: string type: object paths: /test: get: operationId: getTest responses: '200': content: '*/*': schema: items: $ref: '#/components/schemas/Response' type: array servers: - url: https://api.example.com
...this produces a response of type unknown:
unknown
export type get_GetTest = { method: "GET"; path: "/test"; requestFormat: "json"; parameters: never; response: unknown; };
Originally posted by @njbair in https://github.com/astahmer/typed-openapi/issues/51#issuecomment-2341454776
Given the minimal example YAML below, note how the generated schema includes
response: unknown
. After some testing, I determined this only happens when the content type is'*/*'
. If I change it toapplication/json
, it works fine....this produces a response of type
unknown
:Originally posted by @njbair in https://github.com/astahmer/typed-openapi/issues/51#issuecomment-2341454776