RequestBodyMatch

@Serializable
data class RequestBodyMatch(val requiredFields: List<String> = emptyList(), val discriminatorField: String? = null, val discriminatorValue: String? = null)

Narrow request-body match constraints for an Operation, built from its OpenAPI requestBody.content.<mediaType>.schema (see com.worldline.devview.networkmock.core.openapi.OpenApiParser).

This is not JSON Schema validation — only required-field presence and, optionally, a single discriminator field's value are checked (see com.worldline.devview.networkmock.core.repository.RequestMatcher.matchesRequestBody), consistent with how lenient this library's existing path/query matching already is.

See also

Constructors

Link copied to clipboard
constructor(requiredFields: List<String> = emptyList(), discriminatorField: String? = null, discriminatorValue: String? = null)

Properties

Link copied to clipboard

The schema's discriminator.propertyName, or null if the schema declares no discriminator. When non-null, the request body must contain this property (with any value, unless discriminatorValue narrows it further) to match.

Link copied to clipboard

The literal value discriminatorField must equal, sourced from that property's own single-value enum at parse time — null if the discriminator property doesn't declare one, in which case only discriminatorField's presence is checked, not its value.

Link copied to clipboard

Top-level property names the request body's JSON object must contain, from the schema's required array. Empty if the schema declares none.