{"record":{"id":"12d05cc54f5c1871","repo":"faker-ruby/faker","slug":"min-numeric-must-be-greater-than-or-equal-to-0","errorCode":null,"errorMessage":"min_numeric must be greater than or equal to 0","messagePattern":"min_numeric must be greater than or equal to 0","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/faker/default/alphanumeric.rb","lineNumber":50,"sourceCode":"      # @param number [Integer] The number of characters to generate\n      # @param min_alpha [Integer] The minimum number of alphabetic to add to the string\n      # @param min_numeric [Integer] The minimum number of numbers to add to the string\n      #\n      # @return [String]\n      #\n      # @example\n      #   Faker::Alphanumeric.alphanumeric(number: 10) #=> \"3yfq2phxtb\"\n      # @example\n      #   Faker::Alphanumeric.alphanumeric(number: 10, min_alpha: 3) #=> \"3yfq2phxtb\"\n      # @example\n      #   Faker::Alphanumeric.alphanumeric(number: 10, min_alpha: 3, min_numeric: 3) #=> \"3yfq2phx8b\"\n      #\n      # @faker.version 2.1.3\n      def alphanumeric(number: 32, min_alpha: 0, min_numeric: 0)\n        char_count = resolve(number)\n        return '' if char_count.to_i < 1\n        raise ArgumentError, 'min_alpha must be greater than or equal to 0' if min_alpha&.negative?\n        raise ArgumentError, 'min_numeric must be greater than or equal to 0' if min_numeric&.negative?\n\n        return Array.new(char_count) { sample(ALPHANUMS) }.join if min_alpha.zero? && min_numeric.zero?\n\n        raise ArgumentError, 'min_alpha + min_numeric must be <= number' if min_alpha + min_numeric > char_count\n\n        random_count = char_count - min_alpha - min_numeric\n\n        alphas = Array.new(min_alpha) { sample(self::LLetters) }\n        numbers = Array.new(min_numeric) { sample(self::Numbers) }\n        randoms = Array.new(random_count) { sample(ALPHANUMS) }\n\n        combined = alphas + numbers + randoms\n        shuffle!(combined).join\n      end\n    end\n  end\nend\n","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/faker-ruby/faker/blob/cca4184947e09fdd02afb8b89d25a9c8ebc7274e/lib/faker/default/alphanumeric.rb#L32-L68","documentation":"Error \"min_numeric must be greater than or equal to 0\" thrown in faker-ruby/faker.","triggerScenarios":"Thrown at lib/faker/default/alphanumeric.rb:50 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"cca4184947e09fdd02afb8b89d25a9c8ebc7274e","analyzedAt":"2026-08-21T16:25:39.145Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}