У меня есть этот YAML-код чванства, и мне нужно создать свой собственный тип (с именем MyOwnType).
Если я использую "MyOwnType", возникает ошибка компиляции.
paths:
/in/total:
get:
summary: My summary.
description: My description.
parameters:
- name: total
in: query
description: Total.
required: true
type: MyOwnType # -- THIS LINE OCCURS ERROR --
format: MyOwnType
responses:
201:
description: Respose
schema:
$ref: '#/definitions/MyOwnType'
definitions:
MyOwnType:
properties:
var:
type: string
description: data.
Я создал определение «MyOwnType» и могу использовать его следующим образом: «$ref: '#/definitions/MyOwnType'» в схеме.
Но как я могу использовать определение MyOwnType для типа параметра?