pjson 1.0.0
A small, owning JSON value for C++11
Loading...
Searching...
No Matches
ByteDance::pjson::SchemaOptions Struct Reference

Bounds schema regular-expression work. By default only a conservative, non-ambiguous ECMAScript subset is accepted and both pattern/subject sizes are capped, preventing catastrophic std::regex backtracking. trustedRegex() restores unrestricted ECMAScript regex behavior for schemas and input controlled by the application. More...

#include <pjson.h>

Public Member Functions

 SchemaOptions ()
 Public API member SchemaOptions; see the API overview for its contract. / Disables only regex restrictions; all other defaults remain enabled.
 

Static Public Member Functions

static SchemaOptions trustedRegex ()
 Public API member trustedRegex; see the API overview for its contract.
 

Public Attributes

size_t maxRegexPatternBytes
 0 = unlimited (default: 256)
 
size_t maxRegexSubjectBytes
 0 = unlimited (default: 4096)
 
bool allowUnsafeRegex
 default false / Recursive depth (default 512); zero still selects the hard ceiling of 512.
 
size_t maxValidationDepth
 Public API member maxValidationDepth; see the API overview for its contract. / Resolved references (default 1024); zero selects the hard ceiling of 1024.
 
size_t maxRefResolutions
 Public API member maxRefResolutions; see the API overview for its contract. / Validation work units (default 1,000,000); zero selects that hard ceiling.
 
size_t maxValidationWork
 Public API member maxValidationWork; see the API overview for its contract. / Reported errors (default 100); zero selects the hard ceiling of 100.
 
size_t maxErrors
 Public API member maxErrors; see the API overview for its contract.
 
bool validateFormats
 validate known string formats (default true) / Selects bounded safe-regex, traversal, reference, work, error, and format defaults.
 

Detailed Description

Bounds schema regular-expression work. By default only a conservative, non-ambiguous ECMAScript subset is accepted and both pattern/subject sizes are capped, preventing catastrophic std::regex backtracking. trustedRegex() restores unrestricted ECMAScript regex behavior for schemas and input controlled by the application.

Definition at line 313 of file pjson.h.

Constructor & Destructor Documentation

◆ SchemaOptions()

ByteDance::pjson::SchemaOptions::SchemaOptions ( )

Public API member SchemaOptions; see the API overview for its contract. / Disables only regex restrictions; all other defaults remain enabled.

Member Function Documentation

◆ trustedRegex()

static SchemaOptions ByteDance::pjson::SchemaOptions::trustedRegex ( )
static

Public API member trustedRegex; see the API overview for its contract.

Member Data Documentation

◆ allowUnsafeRegex

bool ByteDance::pjson::SchemaOptions::allowUnsafeRegex

default false / Recursive depth (default 512); zero still selects the hard ceiling of 512.

Definition at line 316 of file pjson.h.

◆ maxErrors

size_t ByteDance::pjson::SchemaOptions::maxErrors

Public API member maxErrors; see the API overview for its contract.

Definition at line 324 of file pjson.h.

◆ maxRefResolutions

size_t ByteDance::pjson::SchemaOptions::maxRefResolutions

Public API member maxRefResolutions; see the API overview for its contract. / Validation work units (default 1,000,000); zero selects that hard ceiling.

Definition at line 320 of file pjson.h.

◆ maxRegexPatternBytes

size_t ByteDance::pjson::SchemaOptions::maxRegexPatternBytes

0 = unlimited (default: 256)

Definition at line 314 of file pjson.h.

◆ maxRegexSubjectBytes

size_t ByteDance::pjson::SchemaOptions::maxRegexSubjectBytes

0 = unlimited (default: 4096)

Definition at line 315 of file pjson.h.

◆ maxValidationDepth

size_t ByteDance::pjson::SchemaOptions::maxValidationDepth

Public API member maxValidationDepth; see the API overview for its contract. / Resolved references (default 1024); zero selects the hard ceiling of 1024.

Definition at line 318 of file pjson.h.

◆ maxValidationWork

size_t ByteDance::pjson::SchemaOptions::maxValidationWork

Public API member maxValidationWork; see the API overview for its contract. / Reported errors (default 100); zero selects the hard ceiling of 100.

Definition at line 322 of file pjson.h.

◆ validateFormats

bool ByteDance::pjson::SchemaOptions::validateFormats

validate known string formats (default true) / Selects bounded safe-regex, traversal, reference, work, error, and format defaults.

Definition at line 325 of file pjson.h.


The documentation for this struct was generated from the following file: