Skip to content

Commit c16a6db

Browse files
authored
Fix parsing of options - support missing options (#939)
1 parent 4633c61 commit c16a6db

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

owslib/opensearch.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,12 @@ def __init__(self, md):
197197
p_def = {
198198
'pattern': p.attrib.get('pattern'),
199199
'title': p.attrib.get('title'),
200-
'value': p.attrib.get('value'),
201-
'options': []
200+
'value': p.attrib.get('value')
202201
}
203-
for o in p.findall(nspath_eval('parameters:Option', namespaces)):
204-
p_def['options'].append(o.attrib.get('value'))
202+
203+
options = [o.attrib.get('value') for o in p.findall(nspath_eval('parameters:Option', namespaces))]
204+
if len(options) > 0 :
205+
p_def['options'] = options
205206

206207
url_def['parameters'][p_name] = p_def
207208

0 commit comments

Comments
 (0)