Forcing the API to accept float or string IDs?

Working with LocomotiveCMS on some API integration. Any numbers (eg used for IDs) seem to always be transmitted as floats, regardless of their actual type in my (JS) code. Since I can't change this behavior, is there a way to force the API to accept IDs either as floats or strings? Or any other workarounds that might help with this issue?

0

Comments

2 comments
  • Hi T,

    Currently, the API cannot be used to accept a data type that the field in question is not designed for. You would need to utilize implicit type conversion to change the data into a form accepted.

    0
    Comment actions Permalink
  • Thanks for the quick reply. Unfortunately, I have absolutely no control over the conversion process from the JS object to the transmitted JSON (the part that converts ints to floats), unless I'm missing your point here?

    0
    Comment actions Permalink

Please sign in to leave a comment.