Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/fabricv4_test_runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
uses: actions/cache/save@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml', 'services/fabricv4/src/**/*.java') }}

test:
needs: build
Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:
uses: actions/cache/restore@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml', 'services/fabricv4/src/**/*.java') }}

- name: Tests
working-directory: ./equinix-openapi-fabric-tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,11 @@ public void deleteCloudRouterByUuid() throws ApiException {
public void getCloudRouterActions() throws ApiException {
CloudRouter cloudRouter = createRouter();
cloudRoutersApi.createCloudRouterAction(cloudRouter.getUuid(), new CloudRouterActionRequest().type(CloudRouterActionType.ROUTE_TABLE_ENTRY_UPDATE));
CloudRouterActionResponse cloudRouterActionResponse = cloudRoutersApi.getCloudRouterActions(cloudRouter.getUuid(), CloudRouterActionState.SUCCEEDED);
CloudRouterActionsSearchResponse cloudRouterActionsSearchResponse = cloudRoutersApi.getCloudRouterActions(cloudRouter.getUuid(), CloudRouterActionState.SUCCEEDED);
assertEquals(200, cloudRoutersApi.getApiClient().getStatusCode());
assertEquals(cloudRouterActionResponse.getType(), CloudRouterActionType.ROUTE_TABLE_ENTRY_UPDATE);
assertNotNull(cloudRouterActionsSearchResponse.getData());
assertFalse(cloudRouterActionsSearchResponse.getData().isEmpty());
assertEquals(cloudRouterActionsSearchResponse.getData().get(0).getType(), CloudRouterActionType.ROUTE_TABLE_ENTRY_UPDATE);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public static AllPortsResponse getPorts(UsersItem.UserName userName) throws ApiE
.pagination(new PaginationRequest()
.offset(0)
.limit(100))
.sort(singletonList(new PortSortCriteria().property(PortSortBy._DEVICE_NAME).direction(PortSortDirection.DESC)));
.sort(singletonList(new PortSortCriteria().property(PortSortBy.DEVICE_NAME).direction(PortSortDirection.DESC)));

return portsApi.searchPorts(portV4SearchRequest);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
diff --git a/services/fabricv4/src/main/java/com/equinix/sdk/fabricv4/model/AddOperation.java b/services/fabricv4/src/main/java/com/equinix/sdk/fabricv4/model/AddOperation.java
index 4a87dd55..d0ad5665 100644
--- a/services/fabricv4/src/main/java/com/equinix/sdk/fabricv4/model/AddOperation.java
+++ b/services/fabricv4/src/main/java/com/equinix/sdk/fabricv4/model/AddOperation.java
@@ -248,6 +248,11 @@ public class AddOperation {
JsonObject jsonObj = jsonElement.getAsJsonObject();
// validate the required field `op`
OpEnum.validateJsonElement(jsonObj.get("op"));
+ // check op value matches "add" for AddOperation
+ String opValue = jsonObj.get("op").getAsString();
+ if (!"add".equals(opValue)) {
+ throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected op='add' for AddOperation but got `%s`", opValue));
+ }
if (!jsonObj.get("path").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `path` to be a primitive type in the JSON string but got `%s`", jsonObj.get("path").toString()));
}
diff --git a/services/fabricv4/src/main/java/com/equinix/sdk/fabricv4/model/RemoveOperation.java b/services/fabricv4/src/main/java/com/equinix/sdk/fabricv4/model/RemoveOperation.java
index b03e1b13..6f0ee59e 100644
--- a/services/fabricv4/src/main/java/com/equinix/sdk/fabricv4/model/RemoveOperation.java
+++ b/services/fabricv4/src/main/java/com/equinix/sdk/fabricv4/model/RemoveOperation.java
@@ -222,6 +222,11 @@ public class RemoveOperation {
JsonObject jsonObj = jsonElement.getAsJsonObject();
// validate the required field `op`
OpEnum.validateJsonElement(jsonObj.get("op"));
+ // check op value matches "remove" for RemoveOperation
+ String opValue = jsonObj.get("op").getAsString();
+ if (!"remove".equals(opValue)) {
+ throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected op='remove' for RemoveOperation but got `%s`", opValue));
+ }
if (!jsonObj.get("path").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `path` to be a primitive type in the JSON string but got `%s`", jsonObj.get("path").toString()));
}
diff --git a/services/fabricv4/src/main/java/com/equinix/sdk/fabricv4/model/ReplaceOperation.java b/services/fabricv4/src/main/java/com/equinix/sdk/fabricv4/model/ReplaceOperation.java
index af7babd0..f73d91ac 100644
--- a/services/fabricv4/src/main/java/com/equinix/sdk/fabricv4/model/ReplaceOperation.java
+++ b/services/fabricv4/src/main/java/com/equinix/sdk/fabricv4/model/ReplaceOperation.java
@@ -248,6 +248,11 @@ public class ReplaceOperation {
JsonObject jsonObj = jsonElement.getAsJsonObject();
// validate the required field `op`
OpEnum.validateJsonElement(jsonObj.get("op"));
+ // check op value matches "replace" for ReplaceOperation
+ String opValue = jsonObj.get("op").getAsString();
+ if (!"replace".equals(opValue)) {
+ throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected op='replace' for ReplaceOperation but got `%s`", opValue));
+ }
if (!jsonObj.get("path").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `path` to be a primitive type in the JSON string but got `%s`", jsonObj.get("path").toString()));
}
Loading
Loading