Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds new validations for parsing feature configurations and usage limits. It improves error messages by including supported value options and validates integration, automation, and payment types.
- Update error messages in UsageLimitParser and FeatureParser with detailed supported type listings.
- Introduce explicit checks for integrationType and automationType attributes.
- Add validation for default payment type values ensuring proper list structure.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/main/java/io/github/isagroup/services/parsing/UsageLimitParser.java | Enhanced error message for invalid valueType in usage limits. |
| src/main/java/io/github/isagroup/services/parsing/FeatureParser.java | Improved error messages and validations for integration, automation, and payment types. |
There was a problem hiding this comment.
Pull Request Overview
This PR introduces new validations for parsing usage limits, integrations, automations, and payment types with enhanced error messages that include supported values.
- Updated error messages for valueType in usage limits and features.
- Added explicit handling of integrationType and automationType attributes with new exceptions.
- Enhanced payment parsing validation by ensuring the default value is a list of payment types.
Reviewed Changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/main/java/io/github/isagroup/services/parsing/UsageLimitParser.java | Updated error message to include supported value types. |
| src/main/java/io/github/isagroup/services/parsing/FeatureParser.java | Introduced explicit retrieval and validation for integrationType, automationType, and payment default values with enhanced exception messages. |
Files not reviewed (1)
- src/test/resources/negative-parsing-tests.csv: Language not supported
Comments suppressed due to low confidence (2)
src/main/java/io/github/isagroup/services/parsing/FeatureParser.java:92
- Instead of using a try-catch for retrieving integrationType (which does not throw a NullPointerException when missing), consider checking if map.get('integrationType') is null and then throwing the exception accordingly.
String integrationType = "";
src/main/java/io/github/isagroup/services/parsing/FeatureParser.java:272
- Consider verifying that map.get('defaultValue') is not null before casting to List, as a null value may lead to a NullPointerException during iteration.
List<String> allowedPaymentTypes;
| String automationType = ""; | ||
| try{ | ||
| automationType = (String) map.get("automationType"); | ||
| } catch (NullPointerException e) { |
There was a problem hiding this comment.
Similarly, rather than catching a NullPointerException when obtaining automationType, use an explicit null-check on map.get('automationType') before proceeding.
| String automationType = ""; | |
| try{ | |
| automationType = (String) map.get("automationType"); | |
| } catch (NullPointerException e) { | |
| String automationType = (String) map.get("automationType"); | |
| if (automationType == null) { |
Alex-GF
left a comment
There was a problem hiding this comment.
Thanks for the contribution! Everything is fine.
No description provided.