I have a YAML file in my directory and I want to validate the YAML file was in correct structure using java programming. In online it having lot of YAML checker but I want to validate that on java programming.
Just try to load it with your YAML parser/library. If that throws an error catch it and the structure is invalid. That is the way the online parsers work as well.