-
Notifications
You must be signed in to change notification settings - Fork 738
Closed
Description
Hi,
I have a custom snippet as below:
|===
|Path|Type|Description|Constraints
{{#fields}}
|{{#tableCellContent}}{{path}}{{/tableCellContent}}
|{{#tableCellContent}}{{type}}{{/tableCellContent}}
|{{#tableCellContent}}{{description}}{{/tableCellContent}}
|{{#tableCellContent}}{{constraints}}{{/tableCellContent}}
{{/fields}}
|===
When I set the attribute "constraints" for each field in request fields snippet in Test like this:
key("constraints") .value("Format: YYYY-MM-DD'T'HH:mm:ssZ"))
it works, but when even one field is missing constraints attribute the whole suite fails with:
org.springframework.restdocs.mustache.MustacheException$Context: No method or field with name 'constraints' on line 8
at org.springframework.restdocs.mustache.Template.checkForMissing(Template.java:270)
at org.springframework.restdocs.mustache.Template.getValue(Template.java:178)
at org.springframework.restdocs.mustache.Template.getValueOrDefault(Template.java:223)
at org.springframework.restdocs.mustache.Mustache$VariableSegment.execute(Mustache.java:787)
at org.springframework.restdocs.mustache.Template$1.execute(Template.java:131)
at org.springframework.restdocs.mustache.Template$1.execute(Template.java:124)
at org.springframework.restdocs.mustache.Template$Fragment.execute(Template.java:59)
at org.springframework.restdocs.templates.mustache.AsciidoctorTableCellContentLambda.execute(AsciidoctorTableCellContentLambda.java:36)
How to fix this?
Metadata
Metadata
Assignees
Labels
No labels