python-validators/validators

Document breaking change regarding url(public=...)

Closed this issue · 0 comments

A recent upgrade of this library broke our site, as the existing public=True is now breaking every url validation.

Couple of problems I'd like to mention:

  1. This is a breaking change. Every code which has url(..., public=...) is now broken, but silently. By silently I mean that the URLs are all failing validation, without any warning lines, etc. to let the developer know that this breaking change happened and is not supported.

Here is how it breaks for example:

ValidationError(func=url, args={'reason': "url() got an unexpected keyword argument 'public'", 'value': 'https://example.com', 'public': True})
  1. This is a breaking change, and it should be documented!

  2. A nicer way of handling this would be to add back the public parameter to the function, but just print a warning line to let the developer know it's deprecated.

In summary:

  1. Please document breaking changes.
  2. Make them fail gracefully.
  3. Let the developer know about it, don't just break websites in production.