Class FieldPathPayloadSubsectionExtractor

java.lang.Object
org.springframework.restdocs.payload.FieldPathPayloadSubsectionExtractor
All Implemented Interfaces:
PayloadSubsectionExtractor<FieldPathPayloadSubsectionExtractor>

public class FieldPathPayloadSubsectionExtractor extends Object implements PayloadSubsectionExtractor<FieldPathPayloadSubsectionExtractor>
A PayloadSubsectionExtractor that extracts the subsection of the JSON payload identified by a field path.
Since:
1.2.0
Author:
Andy Wilkinson
See Also:
  • Constructor Details

    • FieldPathPayloadSubsectionExtractor

      protected FieldPathPayloadSubsectionExtractor(String fieldPath)
      Creates a new FieldPathPayloadSubsectionExtractor that will extract the subsection of the JSON payload beneath the given fieldPath. The fieldPath prefixed with beneath- with be used as the subsection ID.
      Parameters:
      fieldPath - the path of the field
    • FieldPathPayloadSubsectionExtractor

      protected FieldPathPayloadSubsectionExtractor(String fieldPath, String subsectionId)
      Creates a new FieldPathPayloadSubsectionExtractor that will extract the subsection of the JSON payload beneath the given fieldPath and that will use the given subsectionId to identify the subsection.
      Parameters:
      fieldPath - the path of the field
      subsectionId - the ID of the subsection
  • Method Details