-
Notifications
You must be signed in to change notification settings - Fork 6
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
LDDTool: erroneously replaces TBD values with null in JSON output #227
Comments
The IMTool/LDDTool software, by default, initializes all attribute values to "TBD_attribute_name". The string "TBD*" is assumed to be a variation of the JAVA value "null" and is ultimately written as "null" if no value is supplied. The proposed fix is to recognize the string "TBD" as a user-provided value and then replace it with something like "_TBD" to eliminate the ambiguity. This is a kludge however it is assumed that all user-provided "TBDs" will ultimately be removed. Comments welcome. It is interesting that this bug was only just found. |
@ztaylor54 ⬆️ let us know if this will not work for you |
This should work. @jshughes is right - all user-provided "TBD*" will ultimately be removed, but while LDDs are in development it adds some confusion. Thanks! |
LDDTool: erroneously replaces TBD values with null in JSON output. When running LDDTool to produce JSON output, <definition> values in <DD_Attribute> that start with TBD are replaced with null in the output. Since LDDTool uses "TBD" as an equivalent for "null" to indicate that a user value was not provided, the solution is to prepend a user supplied "TBD" with "_" resulting in "_TBD". Resolves #227
LDDTool: erroneously replaces TBD values with null in JSON output. When running LDDTool to produce JSON output, <definition> values in <DD_Attribute> that start with TBD are replaced with null in the output. Since LDDTool uses "TBD" as an equivalent for "null" to indicate that a user value was not provided, the solution is to prepend a user supplied "TBD" with "_" resulting in "_TBD". Resolves #227
Describe the bug
When running LDDTool to produce JSON output,
<definition>
values in<DD_Attribute>
that start withTBD
are replaced withnull
in the output.e.g. the below
<DD_Attribute>
became
Note that in the JSON,
description
isnull
.To Reproduce
Steps to reproduce the behavior:
<definition>
attribute on any of the<DD_Attribute>
blocks to start withTBD
-lpJ
options to produce JSON outputattribute
block in JSON output for xpath of attribute you changed toTBD
null
in thedescription
Expected behavior
I expected the text in the
<definition>
attribute to pass through to thedescription
in the JSON output.Version of Software Used
Test Data / Additional context
I suspect the offending code block is in
pds4-information-model/model-dmdocument/src/main/java/gov/nasa/pds/model/plugin/WriteLODSKOSFileDOM.java
:The
.indexOf("TBD") == 0
is functionally equivalent to a.startsWith("TBD")
, so I tested this by adding some text before theTBD
value in the dictionary, then re-running LDDTool:When adding text before the
TBD
, I get the expected behavior.Additional Thoughts
When investigating this bug I was curious if this was an isolated issue, so I did some digging:
So there are a couple occurrences in the offending file, but when I checked the whole repository:
Is
TBD
an official placeholder value that is documented somewhere? Surely it is a reasonable value to have in a dictionary attribute when a value is going to be filled in later, andnull
in the JSON loses that information, and just makes it seem like the value is missing in error.The text was updated successfully, but these errors were encountered: