Skip to content

Commit

Permalink
- #474
Browse files Browse the repository at this point in the history
  • Loading branch information
rathnapandi committed Mar 21, 2024
1 parent 881b079 commit 7f86b33
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Issues exporting and importing an API (See issue [#460](https://github.com/Axway-API-Management-Plus/apim-cli/issues/460))
- Error importing APIs with inbound OAuth (See issue [#459](https://github.com/Axway-API-Management-Plus/apim-cli/issues/459))
- Deleting a V-Host is not considered as a modification (See issue [#457](https://github.com/Axway-API-Management-Plus/apim-cli/issues/457))
- NullPointerException Error when importing a new API with system quotas (See issue [#474](https://github.com/Axway-API-Management-Plus/apim-cli/issues/474))
### Added
- Support Feb 2024 APIM Release (See issue [#461](https://github.com/Axway-API-Management-Plus/apim-cli/issues/461))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,13 @@ public void populateMethodId(API createdAPI, List<QuotaRestriction> mergedRestri
if (restriction.getMethod().equals("*")) continue;
// Additionally, we have to change the methodId
// Load the method for actualAPI to get the name of the method to which the existing quota is applied to
APIMethod actualMethod = methodAdapter.getMethodForId(actualState.getId(), restriction.getMethod());
// Now load the new method based on the name for the createdAPI
APIMethod newMethod = methodAdapter.getMethodForName(createdAPI.getId(), actualMethod.getName());
// Finally modify the restriction
restriction.setMethod(newMethod.getId());
if (actualState != null) {
APIMethod actualMethod = methodAdapter.getMethodForId(actualState.getId(), restriction.getMethod());
// Now load the new method based on the name for the createdAPI
APIMethod newMethod = methodAdapter.getMethodForName(createdAPI.getId(), actualMethod.getName());
// Finally modify the restriction
restriction.setMethod(newMethod.getId());
}
}
}

Expand Down

0 comments on commit 7f86b33

Please sign in to comment.