We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Following the fix for #321, a null pointer exception is provoked by posting a null date value. e.g.
POST /api/catalogueItems/search with body
POST /api/catalogueItems/search
{"searchTerm":"CDW","limit":50,"offset":0,"domainTypes":[],"labelOnly":false,"dataModelTypes":null,"lastUpdatedAfter":null,"lastUpdatedBefore":null,"createdAfter":null,"createdBefore":null,"pageSize":50,"pageIndex":0}
A ParseException is provoked by sending an string which cannot be parsed to a date.
The former can be reproduced by using the UI search function with no dates set (in which case the UI sends null values for each date field).
The latter can be provoked by constructing an unparsable string in Postman.
The endpoint should tolerate null or malformed date strings.
type: "NullPointerException" message: "Cannot invoke "String.length()" because "text" is null" stacktrace: 0: "java.text.SimpleDateFormat.parse(SimpleDateFormat.java:1474)" 1: "java.text.DateFormat.parse(DateFormat.java:397)" 2: "uk.ac.ox.softeng.maurodatamapper.core.rest.transport.search.SearchParams.bindDate(SearchParams.groovy:134)" 3: "uk.ac.ox.softeng.maurodatamapper.core.rest.transport.search.SearchParams.setLastUpdatedAfter(SearchParams.groovy:92)" 4: "jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)" 5: "jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)" 6: "uk.ac.ox.softeng.maurodatamapper.core.rest.transport.search.SearchParams$_bind_closure1.doCall(SearchParams.groovy:116)" 7: "jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)" 8: "jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)" 9: "uk.ac.ox.softeng.maurodatamapper.core.rest.transport.search.SearchParams.bind(SearchParams.groovy:115)" 10: "uk.ac.ox.softeng.maurodatamapper.datamodel.DataModelController.search(DataModelController.groovy:87)" 11: "jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)" 12: "jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)" 13: "org.grails.core.DefaultGrailsControllerClass$ReflectionInvoker.invoke(DefaultGrailsControllerClass.java:211)" 14: "org.grails.core.DefaultGrailsControllerClass.invoke(DefaultGrailsControllerClass.java:188)" 15: "org.grails.web.mapping.mvc.UrlMappingsInfoHandlerAdapter.handle(UrlMappingsInfoHandlerAdapter.groovy:90)" 16: "org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1067)" 17: "org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:963)" 18: "org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)" 19: "org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)" 20: "org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)" 21: "org.grails.web.servlet.mvc.GrailsWebRequestFilter.doFilterInternal(GrailsWebRequestFilter.java:77)" 22: "org.grails.web.filters.HiddenHttpMethodFilter.doFi
develop branch of mdm-core
The text was updated successfully, but these errors were encountered:
gh-323 handle null or malformed date strings
62e9d9b
Merge pull request #324 from MauroDataMapper/feature/gh-323
b8e77dd
aaronforshaw
Successfully merging a pull request may close this issue.
Description
Following the fix for #321, a null pointer exception is provoked by posting a null date value. e.g.
POST /api/catalogueItems/search
with body
A ParseException is provoked by sending an string which cannot be parsed to a date.
Steps to reproduce
The former can be reproduced by using the UI search function with no dates set (in which case the UI sends null values for each date field).
The latter can be provoked by constructing an unparsable string in Postman.
Expected behaviour
The endpoint should tolerate null or malformed date strings.
Screenshots
Environment
develop branch of mdm-core
The text was updated successfully, but these errors were encountered: