Skip to content

[JS] Serialization toJSON methods do not type check #7777

@anna-dingler

Description

@anna-dingler

Platform

  • JavaScript

Issue

The toJSON methods within serialization.ts are not properly checking the type of value. The parent class, PropertyDefinition, allows any as the value type, so typescript will allow any type to be passed to the overloaded methods on the child classes.

See this typescript example

Proposed solution:
Allow all methods to accept any for value and do additional checking within the methods.
See this PR (only some portions are relevant): #7762

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions