Skip to content

Commit

Permalink
Update source builder tests
Browse files Browse the repository at this point in the history
  • Loading branch information
LakshanWeerasinghe committed Jan 9, 2025
1 parent aa20522 commit f175c40
Show file tree
Hide file tree
Showing 16 changed files with 49 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,16 @@ public Map<Path, List<TextEdit>> toSource(SourceBuilder sourceBuilder) {
if (propCodedata == null) {
continue;
}
if (propCodedata.kind().equals(Parameter.Kind.DEFAULTABLE.name())) {
if (propCodedata.kind().equals(Parameter.Kind.PATH_PARAM.name())) {
String pathParamSubString = "[" + key + "]";
String replacement = "[" + property.get().value().toString() + "]";
resourcePath = resourcePath.replace(pathParamSubString, replacement);
} else if (propCodedata.kind().equals(Parameter.Kind.REST_PARAMETER.name())) {
ignoredKeys.add(key);
} else if (propCodedata.kind().equals(Parameter.Kind.PATH_REST_PARAM.name())) {
String replacement = property.get().value().toString();
resourcePath = resourcePath.replace(ParamUtils.REST_PARAM_PATH, replacement);
ignoredKeys.add(key);
}
ignoredKeys.add(key);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@
"label": "Resource Path",
"description": "Resource Path"
},
"valueType": "EXPRESSION",
"codedata": {
"originalName": "/path/to/subdirectory"
},
"value": "/western/apples",
"optional": false,
"editable": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
"label": "Resource Path",
"description": "Resource Path"
},
"codedata": {
"originalName": "/path/to/subdirectory"
},
"valueType": "EXPRESSION",
"value": "/apples",
"optional": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
"label": "Resource Path",
"description": "Resource Path"
},
"codedata": {
"originalName": "/path/to/subdirectory"
},
"valueType": "EXPRESSION",
"value": "/",
"optional": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
"label": "Resource Path",
"description": "Resource Path"
},
"codedata": {
"originalName": "/path/to/subdirectory"
},
"valueType": "EXPRESSION",
"value": "/apples",
"optional": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
"label": "Resource Path",
"description": "Resource Path"
},
"codedata": {
"originalName": "/path/to/subdirectory"
},
"valueType": "EXPRESSION",
"value": "/apples",
"optional": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
"label": "Resource Path",
"description": "Resource Path"
},
"codedata": {
"originalName": "/path/to/subdirectory"
},
"valueType": "EXPRESSION",
"value": "/apples",
"optional": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
"label": "Resource Path",
"description": "Resource Path"
},
"codedata": {
"originalName": "/path/to/subdirectory"
},
"valueType": "EXPRESSION",
"value": "/apples",
"optional": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
"label": "Resource Path",
"description": "Resource Path"
},
"codedata": {
"originalName": "/path/to/subdirectory"
},
"valueType": "EXPRESSION",
"value": "/apples/[varRef]/[12 + 3]",
"optional": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
"label": "Resource Path",
"description": "Resource Path"
},
"codedata": {
"originalName": "/path/to/subdirectory"
},
"valueType": "EXPRESSION",
"value": "/western/apples",
"optional": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
"label": "Resource Path",
"description": "Resource Path"
},
"codedata": {
"originalName": "/path/to/subdirectory"
},
"valueType": "EXPRESSION",
"value": "/apples",
"optional": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
"label": "Resource Path",
"description": "Resource Path"
},
"codedata": {
"originalName": "/path/to/subdirectory"
},
"valueType": "EXPRESSION",
"value": "/",
"optional": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
"label": "Resource Path",
"description": "Resource Path"
},
"codedata": {
"originalName": "/path/to/subdirectory"
},
"valueType": "EXPRESSION",
"value": "/apples",
"optional": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
"label": "Resource Path",
"description": "Resource Path"
},
"codedata": {
"originalName": "/path/to/subdirectory"
},
"valueType": "EXPRESSION",
"value": "/apples",
"optional": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
"label": "Resource Path",
"description": "Resource Path"
},
"codedata": {
"originalName": "/path/to/subdirectory"
},
"valueType": "EXPRESSION",
"value": "/apples",
"optional": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
"label": "Resource Path",
"description": "Resource Path"
},
"codedata": {
"originalName": "/path/to/subdirectory"
},
"valueType": "EXPRESSION",
"value": "/apples/[varRef]/[12 + 3]",
"optional": false,
Expand Down

0 comments on commit f175c40

Please sign in to comment.