-
Notifications
You must be signed in to change notification settings - Fork 49
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
Fiware Headers #148
Comments
* Update crate.py to fix issue with PostalAddress #127 and #129 if attribute is a complex object of unknown type cast it to NGSI_STRUCTURED_VALUE, to store it as object in Crate not finish, still miss the test of complex attribute * add function attrValIsStructured() to test if an attribute value is a structured object * first commit from local dev repo fix syntax error in new function attrValIsStructured * added function to detect structured value & use it in case of unknown NGSI type * quote column names to allow "-" char in name * quote of table and columns names in sql queries * change funtion attrValIsStructured name to _attr_is_structured add test function in test_crate.py: test_accept_unknown_ngsi_type * added reference to issues in new functios test_accept_unknown_ngsi_type test_accept_special_chars * fixed some code climate issues * fixed fiware-service and fiware-servicepath header ( '-' was missing) * quote table name in drop table queries * still issue with drop table add quotes * issue mkssing quote in _refresh function * fix pb in test test_capitals ? * fix pb in test test_capitals again * fixed issues with columns containing capital characters test_capitals works ok now remove lower of attribute names to have correct metadata * restore lowercase for columns names * rolling back fiware header rename, see #148 * turn comment about empty attr into test case.
Hi @c0c0n3 , I want contribute for this issue. Please assign it to me. |
@pooja1pathak awe, thanks! it's your baby now :-) |
Hi @c0c0n3 , I have checked PR #132 and I have following queries:
|
Hi @pooja1pathak, PR #132 had to be reworked, what actually got implemented is PR #142---sorry I should've mentioned this before. In fact, I've just realised one thing that isn't clear from the issue description above is that the renaming of the headers got left out so the header names in the spec never changed, i.e. they're still called https://github.com/smartsdk/ngsi-timeseries-api/blob/master/specification/quantumleap.yml#L123 Again, sorry for the confusion. On to your questions.
Whoops, then the spec has always been out of synch w/r/t the implementation I suppose! If that's the case, can you please check what happens if you https://github.com/smartsdk/ngsi-timeseries-api/blob/master/src/reporter/tests/test_multitenancy.py @chicco785 can you please check what the Portal does? i.e. which set of header are we using there
I suspect we're using |
@pooja1pathak re: your other points above, if we just rename the headers in the spec, then please ignore my comments below since they won't be relevant anymore!
yep, that's correct, but I'd factor that logic out in a single function if possible and add the dashed header versions too which are currently scattered all over the show. It'd be great, if you could do this refactoring for us :-)
Perfect, thanks!
Yep, we'd need to be able to handle all possible combinations... |
@Cerfoglg is the best person to answer |
Hi @c0c0n3 @chicco785, Any update on this? As per my analysis we have used fiware-service and fiware-servicepath in code. fiwareService and fiwareServicePath is only used in API Specification. So, no backward compatibility will be needed.
I think just renaming the headers in the spec will do the thing. Please confirm so that I can raise PR and close this issue. |
Hi @pooja1pathak, We haven't had time to do our due diligence yet but thank you so much for the analysis and yes, if that's the case, I agree with you, all we need to do is rename the headers. Did you test it though? i.e. did you check what happens if you POST a notify request with We'll run a sanity check for our other components next week, but I suppose for the time being you can go ahead with the PR assuming just a rename will do. If you could please add test cases for the two scenarios I mentioned earlier, that'd be great! Thank you sooooo much!!! |
Hi @c0c0n3 ,
Yes I have tested it for all the APIs mentioned in specification. As per my observation and test results, code does not handle fiwareService/fiwareServicePath. Only fiware-Service/fiware-ServicePath (with '-' sign) is considered.
Yes your understanding is correct. fiwareService and fiwareServicePath are ignored and payload gets stored in the default namespace in Crate. |
good stuff!!! thanks for this!
excellent, thanks for checking!!! |
closed by #283 |
PR #132 renamed the Fiware headers in the QL API spec:
fiwareService
→fiware-Service
fiwareServicePath
→fiware-ServicePath
While it's a good thing to align QL header names to Orion's, we also have to take API backward compatibility into account. To this end, we could:
that is, we could support both header names for a few releases and then ditch
fiwareService
andfiwareServicePath
. Under the bonnet QL should be able to handle all four headers at the same time by just taking their content and store it in the corresponding Crate columns. If both new and old headers are specified at the same time in a request, the new should override the old.The text was updated successfully, but these errors were encountered: