mirror of
https://github.com/correl/openapi-core.git
synced 2024-11-22 03:00:10 +00:00
Parameter get_value restructure
This commit is contained in:
parent
da9838b3ac
commit
7aaa5170a6
1 changed files with 3 additions and 5 deletions
|
@ -75,9 +75,7 @@ class Parameter(object):
|
|||
def get_value(self, request):
|
||||
location = request.parameters[self.location.value]
|
||||
|
||||
try:
|
||||
raw = location[self.name]
|
||||
except KeyError:
|
||||
if self.name not in location:
|
||||
if self.required:
|
||||
raise MissingRequiredParameter(
|
||||
"Missing required `{0}` parameter".format(self.name))
|
||||
|
@ -86,12 +84,12 @@ class Parameter(object):
|
|||
raise MissingParameter(
|
||||
"Missing `{0}` parameter".format(self.name))
|
||||
|
||||
raw = self.schema.default
|
||||
return self.schema.default
|
||||
|
||||
if self.aslist and self.explode:
|
||||
return location.getlist(self.name)
|
||||
|
||||
return raw
|
||||
return location[self.name]
|
||||
|
||||
def unmarshal(self, value):
|
||||
if self.deprecated:
|
||||
|
|
Loading…
Reference in a new issue