Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Null Errors, using macros in url with pagination #64

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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 @@ -682,8 +682,8 @@ public void validate() {
}
}

// Validate HTTP Error Handling Map
if (!containsMacro(PROPERTY_HTTP_ERROR_HANDLING)) {
// Validate HTTP Error Handling Map, fix: defer validation at runtime, when url contains a macro
if (!containsMacro(PROPERTY_URL) && !containsMacro(PROPERTY_HTTP_ERROR_HANDLING)) {
List<HttpErrorHandlerEntity> httpErrorsHandlingEntries = getHttpErrorHandlingEntries();
boolean supportsSkippingPages = PaginationIteratorFactory
.createInstance(this, null).supportsSkippingPages();
Expand Down Expand Up @@ -740,8 +740,9 @@ public void validate() {
propertiesShouldBeNotNull.put(PROPERTY_INDEX_INCREMENT,
propertiesShouldBeNull.remove(PROPERTY_INDEX_INCREMENT));
propertiesShouldBeNull.remove(PROPERTY_MAX_INDEX); // can be both null and non null

if (!url.contains(PAGINATION_INDEX_PLACEHOLDER)) {

// fix: defer validation at runtime, when url contains a macro
if (!containsMacro(PROPERTY_URL) && !url.contains(PAGINATION_INDEX_PLACEHOLDER)) {
throw new InvalidConfigPropertyException(
String.format("Url '%s' must contain '%s' placeholder when pagination type is '%s'", getUrl(),
PAGINATION_INDEX_PLACEHOLDER, getPaginationType()),
Expand Down