public static Map < String , Object > getDefaultValues ( Schema schema ) throws SchemaRegistryException { Map < String , Object > defaultValues = new HashMap <> ( ) ; try { defaultValues . putAll ( AvroTypeUtil . getDefaultValuesFromSchema ( schema , new HashSet < String > ( ) ) ) ; } catch ( IOException e ) { throw new SchemaRegistryException ( e ) ; } return defaultValues ; }
Helper method to extract default values from a Schema . This is normally done in DataGeneratorFormat validation however we have to do it at runtime for Schema Registry .