Skip to content
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

Investigate and Fix bug with dateTime CustomAttribute instance JSON property value #6686

Open
christophermlawson opened this issue May 1, 2024 · 1 comment
Assignees
Labels
bug Something isn't working ecschema Issues related to the various ecschema packages

Comments

@christophermlawson
Copy link
Contributor

No description provided.

@christophermlawson christophermlawson self-assigned this May 1, 2024
@christophermlawson christophermlawson added bug Something isn't working ecschema Issues related to the various ecschema packages labels May 1, 2024
@christophermlawson
Copy link
Contributor Author

christophermlawson commented May 1, 2024

From native side, a dateTime typed CustomAttribute instance property is set as a string ("2021-08-19T16:37:42.278") in the returned JSON. This is not validated or processed during deserialization, so the in-memory schema has this set as a string as well. If you then serialize the Schema to xml, the error below occurs, because we are assuming this property value is of type dateTime.

Retrieving Bentley_Civil_Entries.04.00.00
ITwinSlimClient.ts:86
Uncaught TypeError TypeError: propertyValue.getTime is not a function
at writePrimitiveProperty (c:\Source\sandbox\schema-exporter\node_modules@itwin\ecschema-metadata\lib\cjs\Deserialization\XmlSerializationUtils.js:138:61)
at writeInstanceProperty (c:\Source\sandbox\schema-exporter\node_modules@itwin\ecschema-metadata\lib\cjs\Deserialization\XmlSerializationUtils.js:57:19)
at writeCustomAttribute (c:\Source\sandbox\schema-exporter\node_modules@itwin\ecschema-metadata\lib\cjs\Deserialization\XmlSerializationUtils.js:35:19)
at processTicksAndRejections (internal/process/task_queues:95:5)
XmlSerializationUtils.js:138
Process exited with code 1e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ecschema Issues related to the various ecschema packages
Projects
None yet
Development

No branches or pull requests

1 participant