Closed
Description
Is your feature request related to a problem? Please describe.
I work on a REST server that uses PropertyNamingStrategies.SNAKE_CASE
to translate Java property names to JSON field names.
The application code needs to report errors to the REST client, using the translated property names, but it has only the Java names.
PropertyNamingStrategies.SNAKE_CASE
does have a translate
function that does exactly what I need, but it is declared in NamingBase
while SNAKE_CASE
is declaredas PropertyNamingStrategy
.
Describe the solution you'd like
- Declare
public translate(String)
inPropertyNamingStrategy
, or - Declare
PropertyNamingStrategy SNAKE_CASE
asNamingBase
orSnakeCaseStrategy
.
Usage example
Current application code:
import com.fasterxml.jackson.databind.PropertyNamingStrategies.SnakeCaseStrategy;
...
private static SnakeCaseStrategy toSnakeCaseConverter = new SnakeCaseStrategy();
...
propertyName = toSnakeCaseConverter.translate(propertyName);
Application code after change:
import static com.fasterxml.jackson.databind.PropertyNamingStrategies.SNAKE_CASE;
...
propertyName = toSnakeCaseConverter.translate(propertyName);
Metadata
Metadata
Assignees
Labels
No labels