public Optional<Schema> selectSchema(String... segments) {
        if (segments.length == 0) {
            return Optional.of(this);
        }

        String name = segments[0];
        switch (name) {
            case "properties":
                // Grab the property name if present, and skip 2 segments.
                return segments.length == 1
                        ? Optional.empty()
                        : getRecursiveSchema(getProperty(segments[1]), segments, 2);
            case "allOf":
                return getSchemaFromArray(allOf, segments);
            case "anyOf":
                return getSchemaFromArray(anyOf, segments);
            case "oneOf":
                return getSchemaFromArray(oneOf, segments);
            case "propertyNames":
                return getRecursiveSchema(getPropertyNames(), segments, 1);
            case "items":
                return getRecursiveSchema(getItems(), segments, 1);
            case "additionalProperties":
                return getAdditionalProperties();
            case "not":
                return getRecursiveSchema(getNot(), segments, 1);
            default:
                LOGGER.warning(() -> "Unsupported JSONPointer Schema segment: " + name);
                return Optional.empty();
        }
    }
Selects a nested schema using a variadic list of property names
to descend into.

<p>For example, this method can be used to get the items schema nested
inside of an array inside of an object:

<pre>{@code
Schema itemsSchema = schema.selectSchema("properties", "foo", "items").get();
}</pre>

@param segments The properties names to retrieve.
@return Returns the selected Schema.
smithy-jsonschema/src/main/java/software/amazon/smithy/jsonschema/Schema.java