When making swagger more friendly for better code generators, it was noticed that oats drops types of referenced parameters/schemas and instead defines them as any.
Given this swagger, oats generates the following typescript.
openapi: 3.0.0
info:
title: Test API
version: 0.0.0
servers:
- url: ''
paths:
/a:
post:
parameters:
- in: query
name: range
schema:
type: string
enum:
- 24h
- 7d
- 30d
default: 24h
responses:
'200':
description: Success
/b:
post:
parameters:
- in: query
name: range
schema:
$ref: '#/components/schemas/TimeRange'
responses:
'200':
description: Success
components:
schemas:
TimeRange:
type: string
enum:
- 24h
- 7d
- 30d
default: 24h
export interface PostAParams {
query?: {
range?: string;
};
}
export interface PostBParams {
query?: {
range?: any;
};
}
When making swagger more friendly for better code generators, it was noticed that oats drops types of referenced parameters/schemas and instead defines them as
any.Given this swagger, oats generates the following typescript.