-
Notifications
You must be signed in to change notification settings - Fork 4
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
Improve NULL field value and data type error handling #227
Improve NULL field value and data type error handling #227
Conversation
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
300e4ec
to
9d93cfd
Compare
Changed expected behavior in unit test to provide null values in JSON and empty values in XML, which is consistent with current behavior. Improved error handling for data type conformance issues. Related to GSA/fedramp-automation#823.
…straints to not be applied to generated bindings. Fixed a bindling related bug causing some constraints to be applied multiple times, causing spurious errors and warnings. Also refactored the ISource implementation to be more consistent.
c88a135
to
c41b15a
Compare
Committer Notes
Created unit tests to confirm behavior for when a missing field value is encountered.
In XML, the resulting value is an empty string. This is true for both
<field></field>
and<field/>
cases. There is no great way to prevent this using XMLSchema validation, since these conditions are allowed.Depending on the data type implementation, the XML values will result in data type format errors, which are improved in this PR.
If the XML is converted into JSON or YAML, then the resulting content will be
"field": ""
.In JSON and YAML. the resulting value is a
null
value if"field": null
. These will be caught in JSON schema validation.This is an area where normalizing behavior across JSON/YAML and XML is extremely difficult. We may explore other options in the future, but for now #205 will need to kept in the backlog.
This PR also updates the Metaschema module bindings to ensure that missing fields are addressed there, eliminating missing field value warnings that were in the old bindings.
All Submissions:
By submitting a pull request, you are agreeing to provide this contribution under the CC0 1.0 Universal public domain dedication.
Changes to Core Features: