Skip to content

Commit 2bda36f

Browse files
Include parameter descriptions in extracted inputs
1 parent 9566fc6 commit 2bda36f

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

runner/arazzo_runner/extractor/openapi_extractor.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,10 +318,14 @@ def extract_operation_io(
318318
# Add to properties as { 'type': 'openapi_type_string' }
319319
# Required status will be tracked in the top-level 'required' list
320320
is_required = param.get('required', False) # Default to false if not present
321-
extracted_details["inputs"]["properties"][param_name] = {
321+
param_input = {
322322
"type": openapi_type
323-
# Removed "required": is_required from here
324323
}
324+
# Add description if it exists
325+
param_description = param.get('description')
326+
if param_description:
327+
param_input["description"] = param_description
328+
extracted_details["inputs"]["properties"][param_name] = param_input
325329
if is_required:
326330
# Add to top-level required list if not already present
327331
if param_name not in extracted_details["inputs"]["required"]:

runner/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "arazzo_runner"
3-
version = "0.8.14"
3+
version = "0.8.15"
44
description = "Execution libraries and test tools for Arazzo workflows and Open API operations"
55
authors = [
66
{name = "Jentic Labs", email = "info@jenticlabs.com"},

runner/tests/extractor/test_openapi_extractor.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"name": "X-Request-ID",
4040
"in": "header",
4141
"required": False,
42+
"description": "Request identifier for tracing",
4243
"schema": {"type": "string", "format": "uuid"}
4344
}
4445
],
@@ -76,7 +77,7 @@
7677
"type": "object",
7778
"properties": {
7879
"items": {"type": "array", "items": {"$ref": "#/components/schemas/OrderItem"}},
79-
"customer_notes": {"type": "string"}
80+
"customer_notes": {"type": "string", "description": "Additional notes from the customer"}
8081
}
8182
},
8283
"OrderItem": {
@@ -169,8 +170,8 @@ def test_extract_order_post_details():
169170

170171
# Check non-body parameter (simplified schema within properties)
171172
assert "X-Request-ID" in input_properties
172-
# Check type only, required status is in the top-level list
173-
assert input_properties["X-Request-ID"] == {"type": "string"}
173+
# Check type and description, required status is in the top-level list
174+
assert input_properties["X-Request-ID"] == {"type": "string", "description": "Request identifier for tracing"}
174175
# Check that it's NOT required in the top-level list
175176
assert "X-Request-ID" not in extracted["inputs"].get("required", [])
176177

@@ -193,7 +194,7 @@ def test_extract_order_post_details():
193194

194195
# Check the flattened 'customer_notes' property from the body
195196
assert "customer_notes" in input_properties
196-
assert input_properties["customer_notes"] == {"type": "string"}
197+
assert input_properties["customer_notes"] == {"type": "string", "description": "Additional notes from the customer"}
197198

198199
# Check required properties from the body are in the top-level required list
199200
# 'items' is NOT listed in the requestBody schema's top-level required list in TEST_SPEC

0 commit comments

Comments
 (0)