-
Notifications
You must be signed in to change notification settings - Fork 739
Description
At the moment in 1.1, a snippet template can be overridden by providing a classpath resource like org/springframework/restdocs/templates/${name}.snippet
. If this snippet isn't found the default template for the current format is loaded from org/springframework/restdocs/templates/${formatId}/${name}.snippet
. If a user wants to provide different overrides for different snippet formats they have to rely on the ordering of the classpath to get their template in org/springframework/restdocs/templates/${formatId}/
to appear before the default. This isn't user friendly.
The default templates for a particular format should be renamed to make it clear that they are the default and to allow them to be easily overridden. When resolving a template, the search order would then be:
org/springframework/restdocs/templates/${formatId}/${name}.snippet
org/springframework/restdocs/templates/${name}.snippet
org/springframework/restdocs/templates/${formatId}/default-${name}.snippet
2 is provided largely for backwards compatibility with 1.0.
/cc @andreasevers