Is there a way to check if a field is optional?

Hello! I have a class below. If I create an instance of this object, is there a way to check if a field is optional or not? I was hoping to find a method such as user_object.first_name.optional? and have it return true but I have not found one in the documentation. Thank you!

class User < Dry::Struct
attribute :id, Types::Strict::Integer
attribute :first_name, Types::Coercible::String.optional
end

There isn’t a defined public API for this, but you could make one.

User.schema.keys.filter_map { _1.name unless _1.required? }