Skip to content

Commit 9c7fc1d

Browse files
committed
Regenerate Openapi API
Regenerate the API of the add-on "OpenAPI Support" (upcoming version 6).
1 parent 8193c63 commit 9c7fc1d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/zapv2/openapi.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,17 @@ def __init__(self, zap):
2929

3030
def import_file(self, file, apikey=''):
3131
"""
32+
Import an Open API definition from a local file.
3233
This component is optional and therefore the API will only work if it is installed
3334
"""
3435
return six.next(six.itervalues(self.zap._request(self.zap.base + 'openapi/action/importFile/', {'file': file, 'apikey': apikey})))
3536

36-
def import_url(self, url, apikey=''):
37+
def import_url(self, url, hostoverride=None, apikey=''):
3738
"""
39+
Import an Open API definition from a URL, hostOverride allows the host to be replaced
3840
This component is optional and therefore the API will only work if it is installed
3941
"""
40-
return six.next(six.itervalues(self.zap._request(self.zap.base + 'openapi/action/importUrl/', {'url': url, 'apikey': apikey})))
42+
params = {'url': url, 'apikey': apikey}
43+
if hostoverride is not None:
44+
params['hostOverride'] = hostoverride
45+
return six.next(six.itervalues(self.zap._request(self.zap.base + 'openapi/action/importUrl/', params)))

0 commit comments

Comments
 (0)