title: Firestore: REST API runQuery method expects wrong parent path pattern
body: <p>I'm trying to perform a simple query with Firestore REST API.</p>
  
  <p>Being on Google App Engine standard I cannot use the google-cloud-firestore client which is not yet compatible with GAE standard. Instead, I'm using google-api-python-client as for other Google APIs.</p>
  
  <p>This is how I initialize my service:</p>
  
  <pre><code>service = build('firestore', 'v1beta1', credentials=_credentials)
  </code></pre>
  
  <p>Once this is done, I perform the query that way:</p>
  
  <pre><code>query = { "structuredQuery":
            {
              "from": [{ "collectionId": "mycollection" }],
              "where": {
                "fieldFilter":
                {
                  "field": { "fieldPath": "myfield" },
                  "op": "EQUAL",
                  "value": { "stringValue": "myvalue" }
                }
              }
            }
          }
  
  response = service.projects().databases().documents().runQuery(
              parent='projects/myprojectid/databases/(default)/documents',
              body=query).execute()
  </code></pre>
  
  <p>This returns an error quite explicit:</p>
  
  <blockquote>
    <p>TypeError: Parameter "parent" value
    "projects/myprojectid/databases/(default)/documents"
    does not match the pattern
    "^projects/[^/]+/databases/[^/]+/documents/[^/]+/.+$"</p>
  </blockquote>
  
  <p>which obviously is true. My point is that the documentation cleary states that this should be an accepted value:</p>
  
  <blockquote>
    <p>The parent resource name. In the format: <code>projects/{project_id}/databases/{database_id}/documents</code> or <code>projects/{project_id}/databases/{database_id}/documents/{document_path}</code>. For example: <code>projects/my-project/databases/my-database/documents</code> or <code>projects/my-project/databases/my-database/documents/chatrooms/my-chatroom</code> (string)</p>
  </blockquote>
  
  <p>Performing the same query with the API Explorer (or curl) works fine and <strong>returns the expected results</strong>. (even though the API Explorer does state that the parent parameter does not match the expected pattern).</p>
  
  <p><a href="https://i.stack.imgur.com/p6eBw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/p6eBw.png" alt="API Explorer pattern not matching"></a></p>
  
  <p>It seems that the discovery document (which is used by google-api-python-client) enforces this pattern check for the parent parameter but the associated regular expression does not actually allow the only parent path that seems to work (projects/myprojectid/databases/(default)/documents).</p>
  
  <p>I tried to use a different pattern path like <code>projects/myprojectid/databases/(default)/documents/*/**</code>, which makes the query run fine but does not return any results.</p>
  
  <p>Is anyone having the same issue or am I doing something wrong here ?
  The only workaround I can think of is making a request directly to the proper url without using google-api-python-client, but that means that I have to handle the auth process manually which is a pain.</p>
  
  <p>Thanks for any help you could provide !</p>