Open krowvin opened 2 months ago
The issue is this line: https://github.com/USACE/cwms-data-api/blob/297c7929f050895819df0dea6d3bfba1bb16bf8a/cwms-data-api/src/main/java/cwms/cda/data/dao/TimeSeriesDaoImpl.java#L1146C1-L1146C50
Its trying to put a null into a double[].
@rma-rripken I was talking to Daniel about this
Does it make sense for POST to ONLY be able to create NEW timeseries values and not ALSO update existing with a null?
Because it WILL write over existing values (POST will) if there is a value given.
But I think we've established this is OK because you can update other values with values. It's just the null that doesn't work.
So then i'm not sure what the purpose of PATCH is?
Didn't realize this was a duplicate. Should be possible with missing value and missing quality code. value = -340282346638528859811704183484516925440 and quality code = 5 for missing https://github.com/USACE/cwms-data-api/issues/910
Yeah, try again with the latest RC were this was fixed.
@rma-rripken I was talking to Daniel about this
Does it make sense for POST to ONLY be able to create NEW timeseries values and not ALSO update existing with a null?
Because it WILL write over existing values (POST will) if there is a value given.
But I think we've established this is OK because you can update other values with values. It's just the null that doesn't work.
So then i'm not sure what the purpose of PATCH is?
Honestly we mostly put it in because it sematically made sense. I think there is a distinction that PATCH WILL NOT create the time series if it doesn't exist though.
Using POST for Timeseries to set NULL values
Background
Working with @inguyen314 we were discussing the finer points of how to replace-all values in a timeseries with null values.
The idea being you want to write some data from a future forecast, but other data you'd want to make sure was null. Or perhaps the forecast changes and those values are now null for those dates.
Agreement
We both agreed that one should be able to interlace
null
values in a validPOST
request where you may also want to write valid values.Workaround
One could of course call the DELETE method and specify the date range.
Reasons not to?
But in our humble opinion Why not both?
Example
Doing the following results in a NULL POINTER exception in the logs:
This was done in javascript. I do not have a CURL command readily available but here is the Vanilla JS done to test this: