Skip to content

Commit 189507f

Browse files
committed
Remove verbose YARD documentation comments from JWT::JSON class
1 parent 7925810 commit 189507f

1 file changed

Lines changed: 0 additions & 17 deletions

File tree

lib/jwt/json.rb

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,13 @@
33
require 'json'
44

55
module JWT
6-
# JSON parsing utilities with duplicate key detection support
76
# @api private
87
class JSON
98
class << self
10-
# Generates a JSON string from the given data
11-
# @param data [Object] the data to serialize
12-
# @return [String] the JSON string
139
def generate(data)
1410
::JSON.generate(data)
1511
end
1612

17-
# Parses a JSON string with optional duplicate key detection
18-
#
19-
# @param data [String] the JSON string to parse
20-
# @param allow_duplicate_keys [Boolean] whether to allow duplicate keys (default: true)
21-
# @return [Hash] the parsed JSON object
22-
# @raise [JWT::DuplicateKeyError] if allow_duplicate_keys is false and duplicate keys are found
23-
#
24-
# @example Default behavior (allows duplicates, uses last value)
25-
# JWT::JSON.parse('{"a":1,"a":2}') # => {"a" => 2}
26-
#
27-
# @example Strict mode (rejects duplicates)
28-
# JWT::JSON.parse('{"a":1,"a":2}', allow_duplicate_keys: false)
29-
# # => raises JWT::DuplicateKeyError
3013
def parse(data, allow_duplicate_keys: true)
3114
return ::JSON.parse(data) if allow_duplicate_keys
3215

0 commit comments

Comments
 (0)