Document route parameter in nested dictionaries
This commit is contained in:
parent
ec992c083f
commit
34af06b1d1
1 changed files with 17 additions and 0 deletions
|
|
@ -32,9 +32,24 @@ class SettingsProperty(PropertyView):
|
|||
return self.get()
|
||||
|
||||
|
||||
ROUTE_PARAMETER = {
|
||||
"name": "route",
|
||||
"in": "path",
|
||||
"description": (
|
||||
"The location of a key or sub-dictionary. "
|
||||
+ "This is formatted like a path, i.e. forward "
|
||||
+ "slashes delimit components of the path."
|
||||
),
|
||||
"required": True,
|
||||
"schema": {"type": "string"},
|
||||
"example": "camera/exposure_time",
|
||||
}
|
||||
|
||||
|
||||
class NestedSettingsProperty(View):
|
||||
tags = ["properties"]
|
||||
responses = {404: {"description": "Settings key cannot be found"}}
|
||||
parameters = [ROUTE_PARAMETER]
|
||||
|
||||
def get(self, route: str):
|
||||
"""
|
||||
|
|
@ -79,6 +94,7 @@ class StateProperty(PropertyView):
|
|||
class NestedStateProperty(View):
|
||||
tags = ["properties"]
|
||||
responses = {404: {"description": "Status key cannot be found"}}
|
||||
parameters = [ROUTE_PARAMETER]
|
||||
|
||||
def get(self, route):
|
||||
"""
|
||||
|
|
@ -107,6 +123,7 @@ class ConfigurationProperty(PropertyView):
|
|||
class NestedConfigurationProperty(View):
|
||||
tags = ["properties"]
|
||||
responses = {404: {"description": "Status key cannot be found"}}
|
||||
parameters = [ROUTE_PARAMETER]
|
||||
|
||||
def get(self, route):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue