Validate in value before sorting validation
I incorrectly assumed folks wouldn't diverge on the use of the in value from where it was specified in the OpenAPI spec, but in looking at the senlin code, I was wrong. This produces a much more specific warning to explain what is wrong with the parameters file. Change-Id: Idffbd55dcd69d8f9ad988f74eb1b4be4b8a56667
This commit is contained in:
parent
3d24453a9b
commit
ba17a1630b
|
@ -197,6 +197,17 @@ class RestParametersDirective(Table):
|
|||
|
||||
last = None
|
||||
for key, value in yaml_data.items():
|
||||
# use of an invalid 'in' value
|
||||
if value['in'] not in sections:
|
||||
self.app.warn(
|
||||
"``%s`` is not a valid value for 'in' (must be one of: %s)"
|
||||
". (see ``%s``)" % (
|
||||
value['in'],
|
||||
", ".join(sorted(sections.keys())),
|
||||
key)
|
||||
)
|
||||
continue
|
||||
|
||||
if last is None:
|
||||
last = (key, value)
|
||||
continue
|
||||
|
|
Loading…
Reference in New Issue