-
Notifications
You must be signed in to change notification settings - Fork 5
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
Issue 81: touch up XML some #82
Conversation
Does the decode/inflate of the blob to string of XML but now the serializer makes a mess of the XML string doing substitution for all of the XML special characters like '<'. |
Worked on parsing out the <?xml> bits and inserting the pds4 blob as XML. Had it most of the way there when I noticed always getting a plural result when asking for a singular. Fixed that too. Now XML blob is broken again but only for pds4+xml
service/src/main/java/gov/nasa/pds/api/engineering/serializer/Pds4XmlProductSerializer.java
Outdated
Show resolved
Hide resolved
...main/java/gov/nasa/pds/api/engineering/elasticsearch/business/RequestAndResponseContext.java
Outdated
Show resolved
Hide resolved
service/src/main/java/gov/nasa/pds/api/engineering/serializer/Pds4XmlProductSerializer.java
Outdated
Show resolved
Hide resolved
Can you look at the output for the XML types please? I am sure it is not correct but I need to know what tags need fixed and how. The biggest problem is blob needs to be inserted as XML and that is just causing jackson converter to go nuts. I have something working now, but it is less than perfect. I am not trying to reach perfect nor walk the perfect path but just to deliver XML that is good enough. |
Thanks @al-niessner I looked at the new output and that looks good overall. For the details I tried to see how the xmlns prefix should be used and provided some notes on that. I also don't understand why Pds4Metadata tag became the new name of meta. Here are the details of my notes:
since it relates to the pds4 schema which is already in the pds4 tag below.
The id should have a pds_api tag prefix since it relates to the pds_api I would keep the pds_api:meta tag as it is for pds4+json We should not have an ampty xmlns attribute.
Using request:
Should have a
|
@tloubrieu-jpl @al-niessner for this one, let's table it:
I would like to create a new ticket to rename this section altogether to use the |
I left the xmlns in the The double usage is probably because the namespace is required when the blob is taken standalone. Therefore, if you want aesthetic results, then I would remove the ones from the decoded blob since they are technically the redundant definitions. Note: this will be a huge pain to actually do unless you can guarantee that they are all identical in all blobs. |
I added and modified tags are requested. Here is the result but also pushed so feel free to run your own tests:
|
@al-niessner this should be revised: <pds_api:product xmlns:pds_api="http://pds.nasa.gov/api" xmlns="http://pds.nasa.gov/pds4/pds/v1"> should be: <pds_api:product xmlns:pds_api="http://pds.nasa.gov/api"> This namespace |
Removed default namespace.
|
Thanks @al-niessner , I am seeing that the meta content is still without the pds_api prefix. Is it complicated to update ? |
I thought the answer would be yes but it is no. I have nothing else going today so I will just keep working at it but it will not be done before lunch. The jackson XmlMapper is being used to convert that part and it does not obviously accept a namespace qualifier. It must allow it somewhere so I will keep looking. --- more Just googled about and jackson wants '@' attributes to add the namespace. However the bean being translated is part of the code generated by swagger. Not sure I can add them via swagger so looking for more direct method. |
🗒️ Summary
Cleaned up more code. Handle the code more or less uniformly from endpoint to return result.
Update also appears to fix a bug identified here: NASA-PDS/pds-api#155
⚙️ Test Data and/or Report
♻️ Related Issues
Resolves NASA-PDS/pds-api#81
Resolves NASA-PDS/pds-api#73 (update to newest dataset exposed this and then fixing pds4 blob fixed this as well)
Resolves NASA-PDS/pds-api#155
Resolves #456