public String mergeYamls(String source, String patch) throws HyscaleException {
        if(patch == null){
            return source;
        }
        source = DataFormatConverter.yamlToJson(source);
        patch = DataFormatConverter.yamlToJson(patch);
        String strategicMergeJson = StrategicPatch.apply(source, patch, new CustomSnippetsFieldDataProvider());
        try {
            JsonNode jsonNode = ObjectMapperFactory.jsonMapper().readTree(strategicMergeJson);
            return ObjectMapperFactory.yamlMapper().writeValueAsString(jsonNode);
        }catch (IOException e){
            logger.error("Error while converting merged json string to yaml ",e);
        }
        throw new HyscaleException(ManifestErrorCodes.ERROR_WHILE_APPLYING_CUSTOM_SNIPPETS);
    }
This class is responsible for processing Custom K8s Snippets and related operations .

@author Nishanth Panthangi
manifest-generator/generator-services/src/main/java/io/hyscale/generator/services/processor/CustomSnippetsProcessor.java