From d993a8e04dd6e117774786780bd36993188d8509 Mon Sep 17 00:00:00 2001 From: Klaus Hipp Date: Mon, 17 Mar 2025 08:15:43 +0100 Subject: [PATCH] livecheck: update types to allow nested JSON hashes --- Library/Homebrew/livecheck.rb | 2 +- Library/Homebrew/livecheck/options.rb | 2 +- Library/Homebrew/livecheck/strategy.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/livecheck.rb b/Library/Homebrew/livecheck.rb index 10e7a91f99..019612ef17 100644 --- a/Library/Homebrew/livecheck.rb +++ b/Library/Homebrew/livecheck.rb @@ -173,7 +173,7 @@ class Livecheck url: T.any(String, Symbol), homebrew_curl: T.nilable(T::Boolean), post_form: T.nilable(T::Hash[Symbol, String]), - post_json: T.nilable(T::Hash[Symbol, String]), + post_json: T.nilable(T::Hash[Symbol, T.anything]), ).returns(T.nilable(T.any(String, Symbol))) } def url(url = T.unsafe(nil), homebrew_curl: nil, post_form: nil, post_json: nil) diff --git a/Library/Homebrew/livecheck/options.rb b/Library/Homebrew/livecheck/options.rb index 307d393b14..3ef7ca1364 100644 --- a/Library/Homebrew/livecheck/options.rb +++ b/Library/Homebrew/livecheck/options.rb @@ -16,7 +16,7 @@ module Homebrew prop :post_form, T.nilable(T::Hash[Symbol, String]) # JSON data to use when making a `POST` request. - prop :post_json, T.nilable(T::Hash[Symbol, String]) + prop :post_json, T.nilable(T::Hash[Symbol, T.anything]) # Returns a `Hash` of options that are provided as arguments to `url`. sig { returns(T::Hash[Symbol, T.untyped]) } diff --git a/Library/Homebrew/livecheck/strategy.rb b/Library/Homebrew/livecheck/strategy.rb index 92b75552fb..0d33d0671d 100644 --- a/Library/Homebrew/livecheck/strategy.rb +++ b/Library/Homebrew/livecheck/strategy.rb @@ -174,7 +174,7 @@ module Homebrew sig { params( post_form: T.nilable(T::Hash[Symbol, String]), - post_json: T.nilable(T::Hash[Symbol, String]), + post_json: T.nilable(T::Hash[Symbol, T.anything]), ).returns(T::Array[String]) } def self.post_args(post_form: nil, post_json: nil)