Class FormatJsonHelper
- java.lang.Object
-
- com.github.tomakehurst.wiremock.extension.responsetemplating.helpers.HandlebarsHelper<java.lang.Object>
-
- com.github.tomakehurst.wiremock.extension.responsetemplating.helpers.AbstractFormattingHelper
-
- com.github.tomakehurst.wiremock.extension.responsetemplating.helpers.FormatJsonHelper
-
- All Implemented Interfaces:
com.github.jknack.handlebars.Helper<java.lang.Object>
public class FormatJsonHelper extends AbstractFormattingHelper
Handlebars helper to allow JSON to be formatted:```handlebars {{#formatJson format='pretty'}} // Badly formatted JSON {{/formatJson}}``` `format` can be `pretty` or `compact` and defaults to `pretty`
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.github.tomakehurst.wiremock.extension.responsetemplating.helpers.AbstractFormattingHelper
AbstractFormattingHelper.Format
-
-
Field Summary
-
Fields inherited from class com.github.tomakehurst.wiremock.extension.responsetemplating.helpers.HandlebarsHelper
ERROR_PREFIX, ERROR_SUFFIX
-
-
Constructor Summary
Constructors Constructor Description FormatJsonHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.Stringapply(java.lang.String bodyText, AbstractFormattingHelper.Format format)-
Methods inherited from class com.github.tomakehurst.wiremock.extension.responsetemplating.helpers.AbstractFormattingHelper
apply
-
Methods inherited from class com.github.tomakehurst.wiremock.extension.responsetemplating.helpers.HandlebarsHelper
getRequestCache, handleError, handleError, handleError
-
-
-
-
Method Detail
-
apply
protected java.lang.String apply(java.lang.String bodyText, AbstractFormattingHelper.Format format)- Specified by:
applyin classAbstractFormattingHelper
-
-