Giter VIP home page Giter VIP logo

Comments (4)

remi-stripe avatar remi-stripe commented on June 18, 2024

@clement911 The spec does match what our API support today for legacy reasons. Some objects like coupon have a custom id field that you can set to more than 255 characters (and up to 5000). Changing this would be problematic since it could break existing integrations.

Our documentation specifically mentions that it's the values generated by Stripe for an id field will never exceed 255 characters.

EDIT: I'll flag the default_currency one internally to see if it should be fixed but many of our strings can't have a custom limit enforcement because they'd need context. We're working on moving many of this fields to a real enum class though which would solve it in the case of currency and default_currency

from openapi.

clement911 avatar clement911 commented on June 18, 2024

These two were just examples but there seems to be many instances.

For example, the following fields also have a 5k max length:
email
country
mcc (merchant category code)
phone
timezone
disabled_reason
zip code
etc... I'll stop there but there are tons of other.

Is the intent to really leave all of these at 5k?

from openapi.

remi-stripe avatar remi-stripe commented on June 18, 2024

For now, the intent is to leave all of those to 5k yes and many of those fields do support those values. For a bit of historical context, many of our string values had literally no limit for a long time. When we started enforcing limits, we had to choose values that were reasonable while ensuring we don't break any existing integrations. For many fields, we had to settle on 5k because existing integrations were passing over 1k characters regularly.

We could have custom limits for every values, but it also adds overheard for developers to know that zip_code's limit is 10 (and what about custom countries that have zip codes longer?) and that email can't be more than 100 characters, until someone writes in asking for a higher limit, etc.

from openapi.

clement911 avatar clement911 commented on June 18, 2024

I see. I guess I'll work with that.
Hopefully you can set more reasonable values in a future API version (but still with lots of room for edge cases).
Thanks.

from openapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.