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

Date job parameters provided as string #20

Open
goatfryed opened this issue Jul 15, 2020 · 1 comment
Open

Date job parameters provided as string #20

goatfryed opened this issue Jul 15, 2020 · 1 comment

Comments

@goatfryed
Copy link

We'v a job that requires a creationDate as date parameter.

While JobParamUtil checks for date parameters, the issue seems to be that the properties map is never filled with date properties as the deserializer treats them as string by default.

Did I miss any way to force a date or is this feature currently not supported?

@chrisgleissner
Copy link
Owner

Hi,

as you correctly stated, Date parameters which are specified when starting a job are currently provided as String parameters to the job since they are conveyed via the Map<String, Object> field in JobConfig. We rely on Jackson's default JSON deserialization, which is to convert ISO-formatted dates to Strings if the target type is an Object.

Without changing spring-batch-rest, here are two way how you could resolve this:

Please let me know whether this is viable for you and whether you maybe have already found another workaround.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants