Closed
Description
openapi: '3.0.0'
info:
description: 'Description'
version: 'latest'
title: 'Title'
paths:
'/api':
get:
operationId: getData
responses:
200:
$ref: '#/components/responses/default'
components:
responses:
default:
description: OK
content:
'application/json':
schema:
type: object
properties:
data: { type: string }
Generates the types:
export namespace api {
/**
* @name getData
* @request GET:/api
*/
export namespace GetData {
export type RequestQuery = {};
export type RequestBody = never;
export type ResponseBody = any;
}
}
However if the response type is inlined:
openapi: '3.0.0'
info:
description: 'Description'
version: 'latest'
title: 'Title'
paths:
'/api':
get:
operationId: getData
responses:
200:
description: OK
content:
'application/json':
schema:
type: object
properties:
data: { type: string }
The correct type is output:
export namespace api {
/**
* @name getData
* @request GET:/api
*/
export namespace GetData {
export type RequestQuery = {};
export type RequestBody = never;
export type ResponseBody = { data?: string };
}
}