Datatype mismatch between Jira expression and Rest API, can we expect numbers for IDs?

Looking at the Jira Cloud Rest API, some of resource ids are defined as string (eg:,,…).

Now, if I look at the Jira Expression Types, same fields are defined as number.

Can I expect always having a number converted to a string in the Rest API responses ? (in other words, can I safely cast these strings to numbers ?)

This mismatch exists also inside the Rest API, because some “reference” fields are defined as number (eg: Component.projectId, Version.projectId)

The same mismatch exists in Jira Server, where the Jira Server Rest API defines string for entity ids, but if you access entity from the managers in java, internal datatypes are numbers…