We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Don't suggest using -X POST
On https://osv.dev/#use-the-api is the instruction
```
Query by commit hash

curl -X POST -d \
  '{"commit": "6879efc2c1596d11a6a6ad296f80063b558d5e0f"}' \
  "https://api.osv.dev/v1/query"
```

Using `-X POST` here is unnecessary, redundant and potentially dangerous as people cut and paste this into more places. curl will actually tell you this if you add `-v` to this command:

`Note: Unnecessary use of -X or --request, POST is already inferred.`

See also https://daniel.haxx.se/blog/2015/09/11/unnecessary-use-of-curl-x/

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `docs/build.py`
Content:
```
1 # Copyright 2021 Google LLC
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #      http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 """Documentation builder."""
15 
16 import json
17 import os
18 import shutil
19 import subprocess
20 
21 _ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
22 _GENERATED_FILENAME = 'v1/osv_service_v1.swagger.json'
23 
24 
25 def property_description_workaround(definition):
26   """Work around an OpenAPI limitation with a field descriptions getting
27   replaced by the object descriptions."""
28   # Workaround described in https://github.com/Redocly/redoc/issues/835.
29   for value in definition['properties'].values():
30     if '$ref' in value:
31       value['allOf'] = [{'$ref': value['$ref']}]
32       del value['$ref']
33 
34 
35 def replace_property_name(definition, key, replacement):
36   """Replace property name."""
37   definition['properties'][replacement] = definition['properties'][key]
38   del definition['properties'][key]
39 
40 
41 def main():
42   api_dir = os.path.join(_ROOT_DIR, 'gcp', 'api')
43   v1_api_dir = os.path.join(api_dir, 'v1')
44   googleapis_dir = os.path.join(api_dir, 'googleapis')
45   service_proto_path = os.path.join(v1_api_dir, 'osv_service_v1.proto')
46 
47   # Add OSV dependencies.
48   osv_path = os.path.join(api_dir, 'osv')
49   if os.path.exists(osv_path):
50     shutil.rmtree(osv_path)
51 
52   shutil.copytree(os.path.join(_ROOT_DIR, 'osv'), osv_path)
53 
54   subprocess.run([
55       'protoc',
56       '-I',
57       api_dir,
58       '-I',
59       v1_api_dir,
60       '-I',
61       googleapis_dir,
62       '--openapiv2_out',
63       '.',
64       '--openapiv2_opt',
65       'logtostderr=true',
66       service_proto_path,
67   ],
68                  check=True)
69 
70   with open(_GENERATED_FILENAME) as f:
71     spec = json.load(f)
72 
73   spec['host'] = 'api.osv.dev'
74   spec['info']['title'] = 'OSV'
75   spec['info']['version'] = '1.0'
76   spec['tags'] = [{
77       'name': 'api',
78       'x-displayName': 'API',
79       'description': 'The API has 3 methods:'
80   }, {
81       'name': 'vulnerability_schema',
82       'x-displayName': 'Vulnerability schema',
83       'description': 'Please see the [OpenSSF Open Source Vulnerability spec]'
84                      '(https://ossf.github.io/osv-schema/).',
85   }]
86 
87   spec['x-tagGroups'] = [{
88       'name': 'API',
89       'tags': ['api']
90   }, {
91       'name': 'Schema',
92       'tags': ['vulnerability_schema']
93   }]
94 
95   spec['paths']['/v1/query']['post']['tags'] = ['api']
96   spec['paths']['/v1/querybatch']['post']['tags'] = ['api']
97   spec['paths']['/v1/vulns/{id}']['get']['tags'] = ['api']
98 
99   spec['paths']['/v1/query']['post']['x-code-samples'] = [{
100       'lang':
101           'Curl example',
102       'source':
103           ('curl -X POST -d \\\n'
104            '  \'{"commit": "6879efc2c1596d11a6a6ad296f80063b558d5e0f"}\' \\\n'
105            '  "https://api.osv.dev/v1/query"\n\n'
106            'curl -X POST -d \\\n'
107            '  \'{"package": {"name": "mruby"}, "version": "2.1.2rc"}\' \\\n'
108            '  "https://api.osv.dev/v1/query"')
109   }]
110 
111   spec['paths']['/v1/querybatch']['post']['x-code-samples'] = [{
112       'lang':
113           'Curl example',
114       'source':
115           ("""cat <<EOF | curl -X POST -d @- "https://api.osv.dev/v1/querybatch"
116 {
117   "queries": [
118     {
119       "package": {
120         "purl": "pkg:pypi/antlr4-python3-runtime@4.7.2"
121       }
122     },
123     {
124       "commit": "6879efc2c1596d11a6a6ad296f80063b558d5e0f"
125     },
126     {
127       "package": {
128         "ecosystem": "PyPI",
129         "name": "jinja2"
130       },
131       "version": "2.4.1"
132     }
133   ]
134 }
135 EOF""")
136   }]
137 
138   spec['paths']['/v1/vulns/{id}']['get']['x-code-samples'] = [{
139       'lang': 'Curl example',
140       'source': 'curl "https://api.osv.dev/v1/vulns/OSV-2020-111"'
141   }]
142 
143   property_description_workaround(spec['definitions']['v1Query'])
144   property_description_workaround(spec['definitions']['osvVulnerability'])
145 
146   replace_property_name(spec['definitions']['osvVulnerability'],
147                         'databaseSpecific', 'database_specific')
148 
149   with open('sections.md') as f:
150     spec['info']['description'] = f.read()
151 
152   with open(_GENERATED_FILENAME, 'w') as f:
153     f.write(json.dumps(spec, indent=2))
154 
155   shutil.move(_GENERATED_FILENAME, os.path.basename(_GENERATED_FILENAME))
156 
157 
158 if __name__ == '__main__':
159   main()
160
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/docs/build.py b/docs/build.py
--- a/docs/build.py
+++ b/docs/build.py
@@ -100,10 +100,10 @@
       'lang':
           'Curl example',
       'source':
-          ('curl -X POST -d \\\n'
+          ('curl -d \\\n'
            '  \'{"commit": "6879efc2c1596d11a6a6ad296f80063b558d5e0f"}\' \\\n'
            '  "https://api.osv.dev/v1/query"\n\n'
-           'curl -X POST -d \\\n'
+           'curl -d \\\n'
            '  \'{"package": {"name": "mruby"}, "version": "2.1.2rc"}\' \\\n'
            '  "https://api.osv.dev/v1/query"')
   }]
@@ -111,8 +111,7 @@
   spec['paths']['/v1/querybatch']['post']['x-code-samples'] = [{
       'lang':
           'Curl example',
-      'source':
-          ("""cat <<EOF | curl -X POST -d @- "https://api.osv.dev/v1/querybatch"
+      'source': ("""cat <<EOF | curl -d @- "https://api.osv.dev/v1/querybatch"
 {
   "queries": [
     {

{"golden_diff": "diff --git a/docs/build.py b/docs/build.py\n--- a/docs/build.py\n+++ b/docs/build.py\n@@ -100,10 +100,10 @@\n       'lang':\n           'Curl example',\n       'source':\n-          ('curl -X POST -d \\\\\\n'\n+          ('curl -d \\\\\\n'\n            '  \\'{\"commit\": \"6879efc2c1596d11a6a6ad296f80063b558d5e0f\"}\\' \\\\\\n'\n            '  \"https://api.osv.dev/v1/query\"\\n\\n'\n-           'curl -X POST -d \\\\\\n'\n+           'curl -d \\\\\\n'\n            '  \\'{\"package\": {\"name\": \"mruby\"}, \"version\": \"2.1.2rc\"}\\' \\\\\\n'\n            '  \"https://api.osv.dev/v1/query\"')\n   }]\n@@ -111,8 +111,7 @@\n   spec['paths']['/v1/querybatch']['post']['x-code-samples'] = [{\n       'lang':\n           'Curl example',\n-      'source':\n-          (\"\"\"cat <<EOF | curl -X POST -d @- \"https://api.osv.dev/v1/querybatch\"\n+      'source': (\"\"\"cat <<EOF | curl -d @- \"https://api.osv.dev/v1/querybatch\"\n {\n   \"queries\": [\n     {\n", "issue": "Don't suggest using -X POST\nOn https://osv.dev/#use-the-api is the instruction\r\n```\r\nQuery by commit hash\r\n\r\ncurl -X POST -d \\\r\n  '{\"commit\": \"6879efc2c1596d11a6a6ad296f80063b558d5e0f\"}' \\\r\n  \"https://api.osv.dev/v1/query\"\r\n```\r\n\r\nUsing `-X POST` here is unnecessary, redundant and potentially dangerous as people cut and paste this into more places. curl will actually tell you this if you add `-v` to this command:\r\n\r\n`Note: Unnecessary use of -X or --request, POST is already inferred.`\r\n\r\nSee also https://daniel.haxx.se/blog/2015/09/11/unnecessary-use-of-curl-x/\n", "before_files": [{"content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Documentation builder.\"\"\"\n\nimport json\nimport os\nimport shutil\nimport subprocess\n\n_ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\n_GENERATED_FILENAME = 'v1/osv_service_v1.swagger.json'\n\n\ndef property_description_workaround(definition):\n  \"\"\"Work around an OpenAPI limitation with a field descriptions getting\n  replaced by the object descriptions.\"\"\"\n  # Workaround described in https://github.com/Redocly/redoc/issues/835.\n  for value in definition['properties'].values():\n    if '$ref' in value:\n      value['allOf'] = [{'$ref': value['$ref']}]\n      del value['$ref']\n\n\ndef replace_property_name(definition, key, replacement):\n  \"\"\"Replace property name.\"\"\"\n  definition['properties'][replacement] = definition['properties'][key]\n  del definition['properties'][key]\n\n\ndef main():\n  api_dir = os.path.join(_ROOT_DIR, 'gcp', 'api')\n  v1_api_dir = os.path.join(api_dir, 'v1')\n  googleapis_dir = os.path.join(api_dir, 'googleapis')\n  service_proto_path = os.path.join(v1_api_dir, 'osv_service_v1.proto')\n\n  # Add OSV dependencies.\n  osv_path = os.path.join(api_dir, 'osv')\n  if os.path.exists(osv_path):\n    shutil.rmtree(osv_path)\n\n  shutil.copytree(os.path.join(_ROOT_DIR, 'osv'), osv_path)\n\n  subprocess.run([\n      'protoc',\n      '-I',\n      api_dir,\n      '-I',\n      v1_api_dir,\n      '-I',\n      googleapis_dir,\n      '--openapiv2_out',\n      '.',\n      '--openapiv2_opt',\n      'logtostderr=true',\n      service_proto_path,\n  ],\n                 check=True)\n\n  with open(_GENERATED_FILENAME) as f:\n    spec = json.load(f)\n\n  spec['host'] = 'api.osv.dev'\n  spec['info']['title'] = 'OSV'\n  spec['info']['version'] = '1.0'\n  spec['tags'] = [{\n      'name': 'api',\n      'x-displayName': 'API',\n      'description': 'The API has 3 methods:'\n  }, {\n      'name': 'vulnerability_schema',\n      'x-displayName': 'Vulnerability schema',\n      'description': 'Please see the [OpenSSF Open Source Vulnerability spec]'\n                     '(https://ossf.github.io/osv-schema/).',\n  }]\n\n  spec['x-tagGroups'] = [{\n      'name': 'API',\n      'tags': ['api']\n  }, {\n      'name': 'Schema',\n      'tags': ['vulnerability_schema']\n  }]\n\n  spec['paths']['/v1/query']['post']['tags'] = ['api']\n  spec['paths']['/v1/querybatch']['post']['tags'] = ['api']\n  spec['paths']['/v1/vulns/{id}']['get']['tags'] = ['api']\n\n  spec['paths']['/v1/query']['post']['x-code-samples'] = [{\n      'lang':\n          'Curl example',\n      'source':\n          ('curl -X POST -d \\\\\\n'\n           '  \\'{\"commit\": \"6879efc2c1596d11a6a6ad296f80063b558d5e0f\"}\\' \\\\\\n'\n           '  \"https://api.osv.dev/v1/query\"\\n\\n'\n           'curl -X POST -d \\\\\\n'\n           '  \\'{\"package\": {\"name\": \"mruby\"}, \"version\": \"2.1.2rc\"}\\' \\\\\\n'\n           '  \"https://api.osv.dev/v1/query\"')\n  }]\n\n  spec['paths']['/v1/querybatch']['post']['x-code-samples'] = [{\n      'lang':\n          'Curl example',\n      'source':\n          (\"\"\"cat <<EOF | curl -X POST -d @- \"https://api.osv.dev/v1/querybatch\"\n{\n  \"queries\": [\n    {\n      \"package\": {\n        \"purl\": \"pkg:pypi/antlr4-python3-runtime@4.7.2\"\n      }\n    },\n    {\n      \"commit\": \"6879efc2c1596d11a6a6ad296f80063b558d5e0f\"\n    },\n    {\n      \"package\": {\n        \"ecosystem\": \"PyPI\",\n        \"name\": \"jinja2\"\n      },\n      \"version\": \"2.4.1\"\n    }\n  ]\n}\nEOF\"\"\")\n  }]\n\n  spec['paths']['/v1/vulns/{id}']['get']['x-code-samples'] = [{\n      'lang': 'Curl example',\n      'source': 'curl \"https://api.osv.dev/v1/vulns/OSV-2020-111\"'\n  }]\n\n  property_description_workaround(spec['definitions']['v1Query'])\n  property_description_workaround(spec['definitions']['osvVulnerability'])\n\n  replace_property_name(spec['definitions']['osvVulnerability'],\n                        'databaseSpecific', 'database_specific')\n\n  with open('sections.md') as f:\n    spec['info']['description'] = f.read()\n\n  with open(_GENERATED_FILENAME, 'w') as f:\n    f.write(json.dumps(spec, indent=2))\n\n  shutil.move(_GENERATED_FILENAME, os.path.basename(_GENERATED_FILENAME))\n\n\nif __name__ == '__main__':\n  main()\n", "path": "docs/build.py"}], "after_files": [{"content": "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Documentation builder.\"\"\"\n\nimport json\nimport os\nimport shutil\nimport subprocess\n\n_ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\n_GENERATED_FILENAME = 'v1/osv_service_v1.swagger.json'\n\n\ndef property_description_workaround(definition):\n  \"\"\"Work around an OpenAPI limitation with a field descriptions getting\n  replaced by the object descriptions.\"\"\"\n  # Workaround described in https://github.com/Redocly/redoc/issues/835.\n  for value in definition['properties'].values():\n    if '$ref' in value:\n      value['allOf'] = [{'$ref': value['$ref']}]\n      del value['$ref']\n\n\ndef replace_property_name(definition, key, replacement):\n  \"\"\"Replace property name.\"\"\"\n  definition['properties'][replacement] = definition['properties'][key]\n  del definition['properties'][key]\n\n\ndef main():\n  api_dir = os.path.join(_ROOT_DIR, 'gcp', 'api')\n  v1_api_dir = os.path.join(api_dir, 'v1')\n  googleapis_dir = os.path.join(api_dir, 'googleapis')\n  service_proto_path = os.path.join(v1_api_dir, 'osv_service_v1.proto')\n\n  # Add OSV dependencies.\n  osv_path = os.path.join(api_dir, 'osv')\n  if os.path.exists(osv_path):\n    shutil.rmtree(osv_path)\n\n  shutil.copytree(os.path.join(_ROOT_DIR, 'osv'), osv_path)\n\n  subprocess.run([\n      'protoc',\n      '-I',\n      api_dir,\n      '-I',\n      v1_api_dir,\n      '-I',\n      googleapis_dir,\n      '--openapiv2_out',\n      '.',\n      '--openapiv2_opt',\n      'logtostderr=true',\n      service_proto_path,\n  ],\n                 check=True)\n\n  with open(_GENERATED_FILENAME) as f:\n    spec = json.load(f)\n\n  spec['host'] = 'api.osv.dev'\n  spec['info']['title'] = 'OSV'\n  spec['info']['version'] = '1.0'\n  spec['tags'] = [{\n      'name': 'api',\n      'x-displayName': 'API',\n      'description': 'The API has 3 methods:'\n  }, {\n      'name': 'vulnerability_schema',\n      'x-displayName': 'Vulnerability schema',\n      'description': 'Please see the [OpenSSF Open Source Vulnerability spec]'\n                     '(https://ossf.github.io/osv-schema/).',\n  }]\n\n  spec['x-tagGroups'] = [{\n      'name': 'API',\n      'tags': ['api']\n  }, {\n      'name': 'Schema',\n      'tags': ['vulnerability_schema']\n  }]\n\n  spec['paths']['/v1/query']['post']['tags'] = ['api']\n  spec['paths']['/v1/querybatch']['post']['tags'] = ['api']\n  spec['paths']['/v1/vulns/{id}']['get']['tags'] = ['api']\n\n  spec['paths']['/v1/query']['post']['x-code-samples'] = [{\n      'lang':\n          'Curl example',\n      'source':\n          ('curl -d \\\\\\n'\n           '  \\'{\"commit\": \"6879efc2c1596d11a6a6ad296f80063b558d5e0f\"}\\' \\\\\\n'\n           '  \"https://api.osv.dev/v1/query\"\\n\\n'\n           'curl -d \\\\\\n'\n           '  \\'{\"package\": {\"name\": \"mruby\"}, \"version\": \"2.1.2rc\"}\\' \\\\\\n'\n           '  \"https://api.osv.dev/v1/query\"')\n  }]\n\n  spec['paths']['/v1/querybatch']['post']['x-code-samples'] = [{\n      'lang':\n          'Curl example',\n      'source': (\"\"\"cat <<EOF | curl -d @- \"https://api.osv.dev/v1/querybatch\"\n{\n  \"queries\": [\n    {\n      \"package\": {\n        \"purl\": \"pkg:pypi/antlr4-python3-runtime@4.7.2\"\n      }\n    },\n    {\n      \"commit\": \"6879efc2c1596d11a6a6ad296f80063b558d5e0f\"\n    },\n    {\n      \"package\": {\n        \"ecosystem\": \"PyPI\",\n        \"name\": \"jinja2\"\n      },\n      \"version\": \"2.4.1\"\n    }\n  ]\n}\nEOF\"\"\")\n  }]\n\n  spec['paths']['/v1/vulns/{id}']['get']['x-code-samples'] = [{\n      'lang': 'Curl example',\n      'source': 'curl \"https://api.osv.dev/v1/vulns/OSV-2020-111\"'\n  }]\n\n  property_description_workaround(spec['definitions']['v1Query'])\n  property_description_workaround(spec['definitions']['osvVulnerability'])\n\n  replace_property_name(spec['definitions']['osvVulnerability'],\n                        'databaseSpecific', 'database_specific')\n\n  with open('sections.md') as f:\n    spec['info']['description'] = f.read()\n\n  with open(_GENERATED_FILENAME, 'w') as f:\n    f.write(json.dumps(spec, indent=2))\n\n  shutil.move(_GENERATED_FILENAME, os.path.basename(_GENERATED_FILENAME))\n\n\nif __name__ == '__main__':\n  main()\n", "path": "docs/build.py"}]}