Как сослаться на элемент массива в ответе ссылки? - PullRequest
1 голос
/ 02 апреля 2020

Я хочу вернуть список элементов, указав только идентификаторы. Затем я хочу сказать пользователю, что он может получить отдельные детали, вызвав элемент get api. Проблема в том, что я не уверен в синтаксисе, вы можете проверить это?

paths:
 /pet:
get:
  summary: Get all pets
  description: Returns the list of all pets
  operationId: getAllPets
  tags:
    - pet
  parameters:
    - name: full
      in: query
      description: whatever return all or part
      required: false
      schema:
        type: boolean
  responses:
    '200':
      description: The list of all pets in the store, can be full or only first level with partials
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: '#/components/schemas/Pet'
      links:
        getPetDetails:
          description: in case of partial you can use this operation to retrieve individual pet details
          operationId: getPetById
          parameters:
            petId: '$response.body#/id' #...but the response body is an array!
...