Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1319,10 +1319,24 @@
"type": "object",
"properties": {
"url": {
"type": "string"
"allOf": [
{
"$ref": "common_types.json#/$defs/DynamicString"
},
{
"if": {
"type": "string"
},
"then": {
"format": "uri"
}
}
],
"description": "The URL to open."
}
},
"required": ["url"]
"required": ["url"],
"unevaluatedProperties": false
},
"returnType": {
"const": "void"
Expand Down
17 changes: 14 additions & 3 deletions specification/v0_10/json/basic_catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -998,13 +998,24 @@
"type": "object",
"properties": {
"url": {
"type": "string",
"format": "uri",
"allOf": [
{
"$ref": "common_types.json#/$defs/DynamicString"
},
{
"if": {
"type": "string"
},
"then": {
"format": "uri"
}
}
],
Comment on lines +1001 to +1013
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The PR description indicates that no tests were added for these changes, and the pre-launch checklist for tests is unchecked. According to the Repository Style Guide (line 17), code changes should have tests.

Please add test cases (e.g., in specification/v0_10/test/cases/) to verify that the url property correctly validates both literal URIs and dynamic bindings (data paths and function calls), and that invalid literal strings still fail validation as expected.

References
  1. If there are code changes, code should have tests. (link)

"description": "The URL to open."
}
},
"required": ["url"],
"additionalProperties": false
"unevaluatedProperties": false
},
"returnType": {
"const": "void"
Expand Down
25 changes: 25 additions & 0 deletions specification/v0_10/test/cases/function_catalog_validation.json
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,31 @@
}
}
},
{
"description": "openUrl: Valid call with dynamic binding URL",
"valid": true,
"data": {
"version": "v0.10",
"updateComponents": {
"surfaceId": "test",
"components": [
{
"id": "btn1",
"component": "Button",
"child": "txt1",
"action": {
"functionCall": {
"call": "openUrl",
"args": {"url": {"path": "/targetUrl"}},
"returnType": "void"
}
}
},
{"id": "txt1", "component": "Text", "text": "Go"}
]
}
}
},
{
"description": "openUrl: Invalid args (string instead of object)",
"valid": false,
Expand Down
17 changes: 14 additions & 3 deletions specification/v0_10/test/testing_catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,24 @@
"type": "object",
"properties": {
"url": {
"type": "string",
"format": "uri",
"allOf": [
{
"$ref": "common_types.json#/$defs/DynamicString"
},
{
"if": {
"type": "string"
},
"then": {
"format": "uri"
}
}
],
"description": "The URL to open."
}
},
"required": ["url"],
"additionalProperties": false
"unevaluatedProperties": false
},
"returnType": {
"const": "void"
Expand Down
17 changes: 14 additions & 3 deletions specification/v0_9/json/basic_catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -1143,13 +1143,24 @@
"type": "object",
"properties": {
"url": {
"type": "string",
"format": "uri",
"allOf": [
{
"$ref": "common_types.json#/$defs/DynamicString"
},
{
"if": {
"type": "string"
},
"then": {
"format": "uri"
}
}
],
"description": "The URL to open."
}
},
"required": ["url"],
"additionalProperties": false
"unevaluatedProperties": false
},
"returnType": {
"const": "void"
Expand Down
25 changes: 25 additions & 0 deletions specification/v0_9/test/cases/function_catalog_validation.json
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,31 @@
}
}
},
{
"description": "openUrl: Valid call with dynamic binding URL",
"valid": true,
"data": {
"version": "v0.9",
"updateComponents": {
"surfaceId": "test",
"components": [
{
"id": "btn1",
"component": "Button",
"child": "txt1",
"action": {
"functionCall": {
"call": "openUrl",
"args": {"url": {"path": "/targetUrl"}},
"returnType": "void"
}
}
},
{"id": "txt1", "component": "Text", "text": "Go"}
]
}
}
},
{
"description": "openUrl: Invalid args (string instead of object)",
"valid": false,
Expand Down