ynab-sdk-ruby
ynab-sdk-ruby copied to clipboard
Max length for `memo` and `payee_name` does not match what YNAB allows
Hi there! 👋🏻 First I've got to state again how happy I am using YNAB and the API for my own workflow, this is working great!
I recently noticed that some field maximum lengths might not match the actual length limits when using the YNAB web client.
In short, the OpenAPI spec file specifies a maxLength for payee_name and memo fields of respectively 50 and 200, but it's been possible for a long time to create transactions with longer payee name and memo. (I just created a transaction with a 10,000-character long memo!)
I think this issue is very similar to this other issue I opened back in February last year: Validation error on API response for TransactionDetail#import_payee_name, and that it could get a similar fix (Remove unnecessary maxLength validation for import payee fields).
One thing I noticed that might have not been the case last year, is that even if I remove the validations Ruby-side, the API actually responds with an error too:
{"error":{"id":"400","name":"bad_request","detail":"memo is too long (maximum is 200 characters) (index: 19), memo is too long (maximum is 200 characters) (index: 36), memo is too long (maximum is 200 characters) (index: 37)"}}
I could imagine this is happening if YNAB's API server code is also generated with the OpenAPI Generator, based on the same OpenAPI spec. In this case, the fix would require not only a new version of this gem but also an update of YNAB's server-side API code.
Hope this makes sense, but feel free to let me know if you need more details! 🙏🏻