get:
  summary: List issues that match a XPath condition.
  description: Return a collection of issue objects that match a XPath condition.
  security:
    - basic_authentication: []
  parameters:
    - in: query
      name: match
      schema:
        type: string
      required: yes
      description: |
        Expression based in XPath.

        Providing a value of `*` will return all issues.

        Available predicates are:
          - Issue fields: `@name`, `@state`, and `@tracker`.
          - Issue owner fields: `owner/@email`, and `owner/@login`.
      examples:
        all:
          summary: All
          value: '*'
        name:
          summary: Issue name
          value: "@name='5021'"
        function_contains:
          summary: Funcion contains
          value: contains(owner/@email,'my-domain.org')
        combination:
          summary: Tracker and state
          value: "@tracker='bnc' and @state='CLOSED'"
    - $ref: '../components/parameters/search_limit.yaml'
    - $ref: '../components/parameters/search_offset.yaml'
  responses:
    '200':
      description: OK. The request has succeeded.
      content:
        application/xml; charset=utf-8:
          schema:
            $ref: '../components/schemas/search/collection_issues.yaml'
          examples:
            no_results:
              summary: No matching results
              value:
                matches: 0
            two_results:
              summary: Two matching results
              value:
                matches: 2
                issue:
                  - name: 941384
                    created_at: '2015-08-12 06:11:00 UTC'
                    updated_at: '2020-01-09 10:58:33 UTC'
                    tracker: bnc
                    label: boo#941384
                    url: https://opensusebugzilla-next.opensuse.org/show_bug.cgi?id=941384
                    state: CLOSED
                    summary: vmware-guest-kmp is not built for SLE_11_SP3
                    owner:
                      login: user_1
                      email: user_1@example.com
                      realname:
                  - name: 4883
                    created_at: '2018-12-11 03:22:54 UTC'
                    updated_at: '2018-12-11 03:22:54 UTC'
                    tracker: boost
                    label: boost#4883
                    url: https://svn.boost.demo/trac/boost/ticket/4883
    '400':
      description: Bad Request
      content:
        application/xml; charset=utf-8:
          schema:
            $ref: '../components/schemas/api_response.yaml'
          example:
            code: illegal_xpath_error
            summary: unable to evaluate 'foo' for 'issues'
    '401':
      $ref: '../components/responses/unauthorized.yaml'
  tags:
    - Search

post:
  deprecated: true
  summary: List issues that match a XPath condition.
  description: This endpoint is exactly the same as `GET /search/issue`, please use that one.
  tags:
    - Search
