Skip to content

Commit 752fd97

Browse files
committed
Added note on the purpose of build_action_schema
1 parent 326d509 commit 752fd97

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/labthings/server/schema.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,15 @@ def generate_links(self, data, **kwargs):
120120

121121

122122
def build_action_schema(output_schema: Schema, input_schema: Schema, name: str = None):
123+
"""
124+
Builds a complete schema for a given ActionView. That is, it reads any input and output
125+
schemas attached to the POST method, and nests them within the input/output fields of
126+
the generic ActionSchema.
127+
NOTE: This is only for documentation purposes. When Action responses are built by the
128+
HTTP server, the generic ActionSchema will be used for marshaling. This is because the
129+
post() functions return value will already be marshaled because of its @marshal_with
130+
decorator, and thus will already be a formatted dictionary object.
131+
"""
123132
# Create a name for the generated schema
124133
if not name:
125134
name = str(id(output_schema))

0 commit comments

Comments
 (0)