public Optional<String> detectJsonTimestampFormat(Shape shape) {
        if (shape.isTimestampShape() || shape.hasTrait(TimestampFormatTrait.ID)) {
            return Optional.of(shape.getTrait(TimestampFormatTrait.class)
                    .map(TimestampFormatTrait::getValue)
                    .orElseGet(() -> getDefaultTimestampFormat().toString()));
        }
        return Optional.empty();
    }
Detects the TimestampFormat of the given shape, falling back to the
configured default format specified in {@link #setDefaultTimestampFormat(TimestampFormatTrait.Format)}.

@param shape Shape to extract the timestamp format from.
@return Returns the optionally detected format.
smithy-jsonschema/src/main/java/software/amazon/smithy/jsonschema/JsonSchemaConfig.java