private Optional<Schema> getRecursiveSchema(Optional<Schema> schema, String[] segments, int skipOffset) {
        return schema.flatMap(s -> {
            String[] remainingSegments = Arrays.copyOfRange(segments, skipOffset, segments.length);
            return s.selectSchema(remainingSegments);
        });
    }
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