Можно ли использовать одну и ту же схему с разными свойствами в зависимости от пути? Я хочу получить пользователя с userId для пути Users, а пользователя с userId и счетом для пути TopUsers.
paths:
/Users: # user should only have userId property
get:
responses:
200:
description: "successful operation"
content:
application/xml:
schema:
$ref: "#/components/schemas/users"
/TopUsers: # user should have both userId and score properties
get:
responses:
200:
description: "successful operation"
content:
application/xml:
schema:
$ref: "#/components/schemas/users"
components:
schemas:
users:
type: "object"
properties:
user:
type: "array"
xml:
name: "user"
wrapped: false
items:
$ref: "#/components/schemas/user"
xml:
name: "users"
user:
type: "object"
properties:
userId:
type: "integer"
format: "int64"
score: # this property is only for Users, not TopUsers
type: "integer"
format: "int64"
xml:
name: "user"