-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Description
I am experimenting with the new Swagger Gradle plugin and it works very well!
One important feature I am missing, is the possibility to add custom ModelConverter through the gradle resolve{} task configuration. There are configuration options for filterClass, readerClass and scannerClass but not for (multiple) ModelConverter classes.
Background:
I am using dropwizard with PropertyNamingStrategy.SNAKE_CASE for the ObjectMapper and want to generate a static openapi.yaml file through the gradle resolve{} task.
Code example:
Something that I am trying to achieve through the gradle task configuration could be similar to:
ModelConverters.getInstance().addConverter(new SnakeCaseConverter());Custom Converter:
public class SnakeCaseConverter extends ModelResolver {
public SnakeCaseConverter() {
super(createMaper());
}
private static ObjectMapper createMaper() {
ObjectMapper mapper = new ObjectMapper();
mapper.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE);
return mapper;
}
}Metadata
Metadata
Assignees
Labels
No labels