File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -89,14 +89,28 @@ class ActionSchema(Schema):
8989 log = fields .List (fields .Dict ())
9090
9191 href = fields .String ()
92+ links = fields .Dict ()
9293
9394 @pre_dump
9495 def generate_links (self , data , ** kwargs ):
96+ # Add Mozilla format href
97+ # TODO: This should eventually point to the Mozilla action URL
9598 try :
9699 url = url_for (TASK_ENDPOINT , task_id = data .id , _external = True )
97100 except BuildError :
98101 url = None
99102 data .href = url
103+
104+ # Add full link description
105+ # TODO: Reintroduce this type of link to other Thing Description elements
106+ data .links = {
107+ "self" : {
108+ "href" : url ,
109+ "mimetype" : "application/json" ,
110+ ** description_from_view (view_class_from_endpoint (TASK_ENDPOINT )),
111+ }
112+ }
113+
100114 return data
101115
102116
You can’t perform that action at this time.
0 commit comments