code: public static <E> Schema getReaderSchema(Class<E> type, Schema schema) {
      Schema readerSchema = schema;
      GenericData dataModel = getDataModelForType(type);
  
      if (dataModel instanceof SpecificData) {
        readerSchema = ((SpecificData)dataModel).getSchema(type);
      }
  
      return readerSchema;
    }
docs: Get the reader schema based on the given type and writer schema.
  
  @param <E> The entity type
  @param type The Java class of the entity type
  @param schema The {@link Schema} for the entity
  @return The reader schema based on the given type and writer schema