docs(api): document global_regex_flags and deny_list_score on PatternRecognizer - #2255
Merged
omri374 merged 3 commits intoSep 15, 2026
Conversation
…Recognizer PatternRecognizer.from_dict passes every ad_hoc_recognizers key straight to the constructor, so both reach the REST API, but neither appeared in the documented schema. global_regex_flags matters most: it defaults to 26 (DOTALL|MULTILINE|IGNORECASE), which makes every ad-hoc pattern case-insensitive unless a caller overrides it. Closes data-privacy-stack#1603
omri374
enabled auto-merge (squash)
September 15, 2026 08:51
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
Documentation-only changes were reviewed with no blocking issues identified.
Pull request overview
Updates the OpenAPI schema to document two existing PatternRecognizer options.
Changes:
- Documents
deny_list_score. - Documents
global_regex_flags, including its default and case-insensitive behavior.
File summaries
| File | Description |
|---|---|
docs/api-docs/api-docs.yml |
Documents both recognizer configuration fields. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
omri374
approved these changes
Sep 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change Description
AnalyzerRequestbuilds each ad-hoc recognizer withPatternRecognizer.from_dict(rec), which ends incls(**entity_recognizer_dict), so every constructor keyword reaches the recognizer from the request body. Two that affect matching were undocumented.global_regex_flagsis the one that bites: it defaults to 26 (DOTALL | MULTILINE | IGNORECASE), so every ad-hoc pattern is case-insensitive unless a caller overrides it. That is the confusion in #1603, where you confirmed "yes, the api docs are not up to date in this case".7 added lines, no deletions, no behaviour change, wording from
pattern_recognizer.py's docstring. I computed 26 in bothregexand stdlibre.ruff check .passes but does not lint this file, and I did not exercise the HTTP boundary.Issue reference
Fixes #1603
Checklist
No unit tests: an OpenAPI spec document has no runtime behaviour to assert.
🤖 Generated with Claude Code