code: def generate_enum(self):
          
          enum = self._definition['enum']
          if not isinstance(enum, (list, tuple)):
              raise JsonSchemaDefinitionException('enum must be an array')
          with self.l('if {variable} not in {enum}:'):
              enum = str(enum).replace('"', '\\"')
              self.l('raise JsonSchemaException("{name} must be one of {}")', enum)
docs: Means that only value specified in the enum is valid.
  
          .. code-block:: python
  
              {
                  'enum': ['a', 'b'],
              }