#Nestor
1 messages · Page 1 of 1 (latest)
HI 👋 I don't think there is a great way to distinguish what your code should consider an ID and what is a fixed part of the path without telling it explicitly where to look.
The only approach that comes to mind, and I'm not sure how exactly to implement it or if it is possible, is to pull from our OpenAPI spec to find what paths have id values in them and where:
https://github.com/stripe/openapi
so, there isn't a regexp I could use to identify all ids?
You might be able to build one, but I don't know what that would be off-hand.
that's what I'm trying. I will see if I can find one that works with all the fixtures at least
Thanks
Most of our objects use a 2-3 character prefix, followed by an underscore, and ending with an alphanumeric string (though there are exceptions like Coupons where the id can be custom defined). Some objects (like Checkout Sessions) will have a test or live string included in between the ID prefix and the ID. You might be able to use that as a starting point.
good to know about coupons, I didn't think of that one