Apidog Dynamic Values leverages Faker.js v9.0.0-rc.1 to deliver deterministic, locale-aware test data that can be generated once and reused across requests, eliminating scripting overhead while preserving full compatibility with existing Faker expressions.Comprehensive Dynamic Value Library#
For easy reference, Apidog provides documentation with examples for each dynamic value category, mirroring the structure of Faker.js:Key Enhancements in Apidog Dynamic Values#
Here are the key changes that make Apidog Dynamic Values even more powerful and user-friendly:1. Simplified Expression Syntax for Easy Access#
Apidog uses a concise and intuitive syntax for calling dynamic values:Faker.js: faker.finance.accountName()
Apidog: {{$finance.accountName}}
Simply type {{% within Apidog to trigger auto-completion and effortlessly explore the available dynamic values.2. Optimized Output for Objects and Arrays#
Apidog simplifies data handling by returning JSON strings for methods that originally returned objects or arrays in Faker.js, enabling direct access to specific values.Faker.js: faker.airline.airport() returns an object:Apidog: Access specific fields directly:Example 2: Handling Multiple Dates#
Faker.js: faker.date.betweens() returns an array:Apidog: Returns a JSON stringified array for straightforward data processing:For a comprehensive overview of adjusted methods and their parameters, refer to the Apidog documentation.
3. Enhanced Locale Control#
Apidog provides enhanced control over Locale settings for generating region-specific data:Function-Level Settings: Define Locale settings individually for each dynamic value function.
Project-Level Defaults: Set a default Locale for your entire Apidog project.
Date Formatting Overrides: Utilize the format method within date-related functions to apply Locale-specific formatting overrides.
4. Preset Parameters for Common Use Cases#
Apidog boosts your efficiency by providing preset parameters for frequently used methods (customizable as needed):{{$helpers.fromRegExp('[A-Z0-9]{4}-[A-Z0-9]{4}')}} // Generates strings matching a regular expression
{{$helpers.arrayElement(['abc','123'])}} // Randomly selects an element from an array
{{$helpers.arrayElements(['abc','123'])}} // Selects multiple random elements from an array
{{$helpers.replaceSymbols('##??**')}} // Replaces special symbols with random characters
{{$helpers.slugify('abc 123')}} // Generates a URL-friendly slug
5. Expanded Dynamic Value Library#
Apidog enriches your data generation capabilities with new categories and methods:New Category: food for generating diverse food-related data. Example: {{$food.vegetable}}
{{$date.timeZone}} for generating time zone data.
{{$music.album}} for creating realistic music album names.
{{$music.artist}} for generating artist names.
Enhanced Method Parameters:{{$phone.number(style='human')}} for generating human-readable phone numbers, such as: (555) 123-4567.
{{$number.int(multipleOf=3)}} for generating integers divisible by a specified number.
6. Unlimited Concatenation#
Apidog provides ultimate flexibility by allowing you to seamlessly combine Mock data and dynamic values without limitations, enabling the creation of rich and realistic test scenarios.7. Expanded Date Functionality#
Apidog extends date-related functions with new parameters for formatting, offset calculation, and more, catering to diverse and complex testing requirements.