SchemaExampleValueGeneratorOptions
Configuration options for SchemaExampleValueGenerator.
Controls the behavior of example value generation from OpenAPI schemas.
Java callers: start from REQUEST_DEFAULTS or RESPONSE_DEFAULTS and adjust via the with* methods instead of the positional constructor:
var options = SchemaExampleValueGeneratorOptions.RESPONSE_DEFAULTS.withFullExample(true);Note: when a generator is used through the ResponseExampleExtractor(SchemaExampleValueGenerator) constructor, response extraction applies RESPONSE_DEFAULTS for the include/fallback flags and only honors maxExampleDepth and fullExample from the configured options.
Constructors
Properties
When true, generates a complete example: every declared property (required and optional, regardless of explicit examples) is populated, and every array contains at least one item. For composed schemas (oneOf/anyOf), a single variant is produced. includeWriteOnly and depth/cycle guards still apply.
When true, includes optional properties that have explicit examples
When false, excludes writeOnly properties (appropriate for response examples)
Maximum depth for recursive schema traversal (default: 50)
When true, falls back to schema.examples and schema.default if no example found
Functions
Returns a copy with fullExample replaced. Java-friendly alternative to copy.
Returns a copy with includeOptionalExampleProperties replaced. Java-friendly alternative to copy.
Returns a copy with includeWriteOnly replaced. Java-friendly alternative to copy.
Returns a copy with maxExampleDepth replaced. Java-friendly alternative to copy.
Returns a copy with useSchemaExampleFallback replaced. Java-friendly alternative to copy.