private void writeSchemaFile(String schema, String documentType) throws IOException {
        // remove the comment from the first line
        schema = schema.replace("# This is a template that will be filled in with the actual schema", "");
        
        Path targetSchemaPath = Paths.get("schemas", documentType + ".sd");
        Path filePath = Paths.get(config.getApplicationPackageDir()).resolve(targetSchemaPath);
        Files.write(filePath, schema.getBytes(StandardCharsets.UTF_8));
    }
Writes the schema file by replacing template placeholders with definitions of detected fields.

@param detectedFields The fields detected in the input data
@throws IOException if an error occurs while writing the schema file
integration/logstash-plugins/logstash-output-vespa/src/main/java/org/logstashplugins/VespaAppPackageWriter.java