0

I'm writing a book schema with Cerberus but I've stumbled upon a block. I want the ISBN field to accept a number/integer/digit that is either 10 digits long, or 13. How can I go about that? I tried using maxlength and minlength but they don't seem to work.

dreftymac
  • 31,404
  • 26
  • 119
  • 182
Nerldy
  • 1
  • Cerberus doesn't use JSON Schema, so any assumptions you've made that it uses JSON Schema are wrong. https://github.com/pyeve/cerberus/issues/254 – Relequestual Apr 30 '18 at 08:39

1 Answers1

2

Since you're dealing with integers, the rules min and max can be used to define constraints on a field's minimum or maximum value.

As always, you're very likely to get a helpful answer when you provided some code examples of what you've achieved so far.

funky-future
  • 3,716
  • 1
  • 30
  • 43