Yeah, it definitely needs improvement. For even more consistency with the rest of the code we could go:

      func (t *typeValidator) UnmarshalJSON(b []byte) error {                          
          *t = make(typeValidator)                                                     
          var s string                                                                 
          var l []string                                                               
                                                                                       
          // The value of the "type" keyword can be a string or an array.              
          if err := json.Unmarshal(b, &s); err != nil {                                
              err = json.Unmarshal(b, &l)                                              
              if err != nil {                                                          
                  return err                                                           
              }                                                                        
          } else {                                                                     
              l = []string{s}                                                          
          }                                                                            
                                                                                       
          for _, val := range l {                                                      
              (*t)[val] = true                                                         
          }                                                                            
          return nil                                                                   
      }

.. though it's a few more lines than just adding `return err`. Got a preference?