-
Notifications
You must be signed in to change notification settings - Fork 3
Pds api 110: unify the behavior of response building #80
Conversation
Basically scrapped what was there and reqbuilt it all using a visitor pattern that will hopefully consolidate changes that fix all endpoints instead of so much cut-n-past. There is still a lot of boilerplate thata may be able to be worked out with more effort.
@tloubrieu-jpl @jordanpadams @tdddblog Its finally in place. Needs testing which I will get to Wednesday probably. Let me know if you want to review it in the breakout tomorrow. |
Had to add "accept: application/json to the verify scripts. This moved them formward but have some odd results like the query language changed without updating the test. Other items are still failing and will need to track them down one by one but the problems are no longer in the verify scripts. Added some missed functinality in the product handler. Cleaned up some logic in the RequestAndResponseContext that does the bulk of the work for mixing and matching the various application type requests. Added a new error to account for when valid information was given (lidvid) but nothing was found despite that.
The looking up a lidvid from lid required a touch more fine tuning to verify that it found the whole lidvid matches the given to accound for partial lidvids that are more than a lid but less than a full lidvid. Had to also clean up a List<String>.toArray() that was causing a segfault. Turning a list to [] syntax is not so easy to understand.
@tloubrieu-jpl @tdddblog @jordanpadams All the tests, not query language related, work now. You can get either PDS-4 (pds4+json) format or our favorite format (json). You can add new output styles simply by adding to the table RequestAndResponseContext.formatters. |
The work of making the product and adding them all to the endpoints. THe work of adding a serializer is a touch more complicated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @al-niessner ,
I am getting null pointer exception with the following requests:
curl --location --request GET 'http://localhost:8080/collections?limit=10'
--header 'Accept: application/json'
and
curl --location --request GET 'http://localhost:8080/products?only-summary=True'
--header 'Accept: application/json'
I am using pds-api-javalib branch swaggerhub-pds_federated_api-pds-api-110-4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@al-niessner in the API spec, shouldn't this:
application/csv+text:
schema:
$ref: '#/components/schemas/wyriwygProduct'
be this?
text/csv:
schema:
$ref: '#/components/schemas/wyriwygProduct'
also I'm guessing wyriwygProduct
is just a placeholder for those other inwork response formats?
Can change application/cvs+text to text/cvs at any time.
WYRIWIG - What You Request Is What You Get. Stolen from WYSIWIG editors. If
you want a better name, make it up and it can be changed.
…On Fri, Nov 12, 2021 at 10:39 AM Jordan Padams ***@***.***> wrote:
***@***.**** commented on this pull request.
@al-niessner <https://github.com/al-niessner> in the API spec, shouldn't
this:
application/csv+text:
schema:
$ref: '#/components/schemas/wyriwygProduct'
be this?
text/csv:
schema:
$ref: '#/components/schemas/wyriwygProduct'
also I'm guessing wyriwygProduct is just a placeholder for those other
inwork response formats?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#80 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIUBIVRGODL46IILQDA4SLULVNOFANCNFSM5HFBKXPA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
That is the right javalib branch. I do not get a null pointer exception.
…On Thu, Nov 11, 2021 at 10:48 AM thomas loubrieu ***@***.***> wrote:
***@***.**** commented on this pull request.
Hi Al,
I am getting null pointer exception with the following requests:
curl --location --request GET 'http://localhost:8080/collections?limit=10'
--header 'Accept: application/json'
and
curl --location --request GET '
http://localhost:8080/products?only-summary=True'
--header 'Accept: application/json'
I am using pds-api-javalib branch
swaggerhub-pds_federated_api-pds-api-110-4
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#80 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIUBIRV2M43VAUSH73F3RTULQFYXANCNFSM5HFBKXPA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Hi @al-niessner , do you use a specific branch for the csv development ? If not you should branch off of this branch pds-api-110 to create a new branch for the CSV development so that this pds-api-110 stays stable for the tests. Thanks |
Sorry, forgot to create a new branch. I will do that for te webmvcc portion.
…On Fri, Nov 12, 2021 at 11:44 AM thomas loubrieu ***@***.***> wrote:
Hi @al-niessner <https://github.com/al-niessner> , do you use a specific
branch for the csv development ? If not you should branch off of this
branch pds-api-110 to create a new branch for the CSV development so that
this pds-api-110 stays stable for the tests.
Thanks
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#80 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIUBIR67RO7SLMZU7YWU4LULVVAFANCNFSM5HFBKXPA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
This is not due to my changes. The input coming in from the curl makes q null. The search request builder is unmodified so the problem may be inherited from the main branch. First, I added these two log lines:
and produce this result:
Second, I went back to the main branch to test it. It works fine because somewhere it is translating the null to "". Going to update for that and see if it works. |
Thanks @al-niessner |
The blank query had to use the preset which got lost. Also put the conversion of the names back in place.
Fixed up the curl. Please try again or continue with review. |
Accidentally made it so only the minimal set was returned if fields are left blank. Added a min/max list of fields where min must be a subset of max and empty is a full set without having to define all that may be in elastic search. This min/max approach fixes the blank fields and adds constraints so that pds+ formats will only every reeturn the allowable keys and nothing else. These are simple to change in the future as well by modifying just the min/max arrays.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to go, no much time to look at the details but that worked with my tests
🗒️ Summary
Brief summary of changes if not sufficiently described by commit messages.
⚙️ Test Data and/or Report
One of the following should be included here:
♻️ Related Issues