convertToJson method

String convertToJson(
  1. String camelCasePropertyName
)

Converts a property name from camelCase to the configured JSON naming convention.

Uses the configured jsonNamingConvention or defaults to camelCase.

@param camelCasePropertyName The property name in camelCase format. @returns The property name converted to the JSON naming convention.

Implementation

String convertToJson(String camelCasePropertyName) {
  final convention = jsonNamingConvention ?? CamelCaseConvention();
  return convention.fromCamelCase(camelCasePropertyName);
}