| Re: [smila-user] smila date value vs. new processing |
Hi, after some discussions with colleaques we think that we should do an auto-detection of date/timestamp values when parsing them from JSON or BON. This would mean that - a string value of format âyyyy-MM-ddâ and being a valid date would be instantiated as a Value with type DATE. - a string value of format âyyyy-MM-dd'T'HH:mm:ss(.fff)Zâ (i.e. the .fff part is optional, but timezone is mandatory) and valid values for the date and time parts would be instantiated as a Value of type TIMESTAMP. Additionally we would take care that value.asString() would return the original representation so that a user gets the correct value in any case if (s)he is just interested in the string value and does not want to treat it as a date/timestamp. This would keep the JSON APIs cleaner than having type tags in the string values. We could probably implement this in the next days if there are no major objections. Cheers, Juergen. From: smila-user-bounces@xxxxxxxxxxx [mailto:smila-user-bounces@xxxxxxxxxxx] On Behalf Of Thomas Menzel Since I have not much experience in JSON myself, I really donât have an opinion if that is a good solution or not and say: whatever u think is best, I vote for it. If anyone wants to say smth. for or against it chime in. Thomas Menzel @ brox IT-Solutions GmbH From: smila-user-bounces@xxxxxxxxxxx [mailto:smila-user-bounces@xxxxxxxxxxx] On Behalf Of Igor Novakovic Thanks Thomas for pointing this out. I discussed this with JÃrgen yesterday and we came up with several solutions of which we both currently prefer the one that adds the type of the value in the string value (of course only for date and timestamp values): - an Any-Date would be serialized as â2011-01-01@type:dateâ, - an Any-Timestamp would be serialized as â2011-01-01T12:34:56.789+0200@type:timestampâ The effort to implement this solution would be minimal (compared to other solutions). Besides that we will handle this problem exactly the same both in JSON and in BON. What do you think? BTW: This approach is not new: http://weblogs.asp.net/bleroy/archive/2008/01/18/dates-and-json.aspx Cheers Igor Von: smila-user-bounces@xxxxxxxxxxx [mailto:smila-user-bounces@xxxxxxxxxxx] Im Auftrag von Thomas Menzel Ok thx. I have opened bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=359187 for this and had to give it major prio (after considering critical) due to the effect on existing installations. @igor We need to see if that stalls our release. Thomas Menzel @ brox IT-Solutions GmbH From: smila-user-bounces@xxxxxxxxxxx [mailto:smila-user-bounces@xxxxxxxxxxx] On Behalf Of JÃrgen Schumacher Hi, Yes, good point, I was bothered about this myself, but there were other prioritiesâ I think it should be simple to extend BON to include the type information for string values, and that should solve most problems. Iâll have a look into it when making the specs public, but Iâll also have to do some discussions with colleagues. Iâm not sure yet what we good do about it in JSON. Maybe we could use JSON annotations. Iâll have to take a look into it. Cheers, JÃrgen. From: smila-user-bounces@xxxxxxxxxxx [mailto:smila-user-bounces@xxxxxxxxxxx] On Behalf Of Thomas Menzel Hi folks, The json spec states that dates are converted to strings and if u need dates u convert them urself if needed. I want to use XML anyhow, so no problem, right? Well, not quite it seems. With the new processing (no AMQ) it seems that internally Json/BON is used and as a consequence I donât get date values anymore into my pipelines. Is there any way to preserve the date value as a type? Any tricks? If not: I think we would need to amend this! After all: what would be the point of the date type then? Thomas Menzel @ brox IT-Solutions GmbH Taglocity Tags: smila |