private void handleModelDiscovery(ModelAssembler assembler, ClassLoader baseLoader, SmithyBuildConfig config) {
        String discoverClasspath = null;
        boolean discover = false;
        if (arguments.hasReceiver(DiscoveryOptions.class)) {
            DiscoveryOptions discoveryOptions = arguments.getReceiver(DiscoveryOptions.class);
            discoverClasspath = discoveryOptions.discoverClasspath();
            discover = discoveryOptions.discover();
        }

        if (discoverClasspath != null) {
            discoverModelsWithClasspath(discoverClasspath, assembler);
        } else if (shouldDiscoverDependencies(config, discover)) {
            assembler.discoverModels(baseLoader);
        }
    }
Loads, builds, and report validation issues with models.
smithy-cli/src/main/java/software/amazon/smithy/cli/commands/ModelBuilder.java