[🍒][PLUGIN-1895] Fixing datatype mismatch issue when value type is display #98
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
cherrypick: #96
Current Issue:
It has been observed that when the display value type is selected, some values that are defined as integers in the schema appear as strings.
Code Changes:
The changes are made on how the schema is fetched. The API associated for fetching the schema is changed to use the column metadata api which now fetches the schema.
Schema API: baseUrl/api/now/doc/table/schema/tableName
Column Metadata API: baseUrl/api/now/ui/meta/tableName
In accordance with the response from the column metadata API, the SchemaResponse class is also changed to accommodate the changes. Before mapping the datatype, a check is applied that if the value type is display and if there is a mismatch between the internal_type and type then it needs to be mapped to the type otherwise internal_type.
Testing:
The code changes are verified by running unit tests and e2e tests. Also, did run the pipelines for some of the tables for Display and Actual value type.
JIRA Ticket: https://cdap.atlassian.net/browse/PLUGIN-1895