Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ Each release links to full notes on the

## [Unreleased]

### Documentation

- Dynamic Model Creation no longer reads as if 0.85 were the `str` default:
`vendor: str` gets it from its name, and a `str` field that no name rule
matches gets 0.7. The page also says when `explain()` reports `explicit`
for a field you did not configure
([#489](https://github.com/awslabs/stickler/issues/489)).

## [1.1.0] - 2026-12-04

### Added
Expand Down
14 changes: 13 additions & 1 deletion docs/docs/Advanced/dynamic-models.md
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,17 @@ declared type cannot support reports `type`, because the type default is what
shipped -- `row['why']` records the refusal. These are the same values
`stickler.evaluate()` reports, so the two paths read alike.

`explicit` is not always a field you configured. A model from `from_json_schema()`
infers only the fields that `x-aws-stickler-infer-unspecified` or
`x-aws-stickler-comparator: "auto"` reaches, so every other field reports `explicit`,
including fields left at the type default. A model from `from_pydantic()` reports
`explicit` for every field, even where Stickler picked the comparator from the type or
the name; run `stickler.eval_for()` on the Pydantic class itself to see `type` and
`name-token`. A hand-written `StructuredModel` class also reports `explicit` for every
field, but nothing there is picked from the name, and a bare `int` or `float` field is
compared as text by `LevenshteinComparator` (see
[Precedence, in one line](../Getting-Started/thresholds-and-metrics.md#precedence-in-one-line)).

`row['why']` gives the full reasoning:

```python
Expand All @@ -503,7 +514,8 @@ Both the comparator and the threshold, matching `stickler.evaluate()`:
| `total: float` | NumericComparator @ 0.5 | NumericComparator @ 0.95 |
| `paid: bool` | ExactComparator @ 0.5 | ExactComparator @ 1.0 |
| `issued` (`format: date`) | DateComparator @ 1.0 | DateComparator @ 0.95 |
| `vendor: str` | LevenshteinComparator @ 0.5 | LevenshteinComparator @ 0.85 |
| `vendor: str` | LevenshteinComparator @ 0.5 | LevenshteinComparator @ 0.85 (from the name `vendor`) |
| `color: str` (no name rule matches) | LevenshteinComparator @ 0.5 | LevenshteinComparator @ 0.7 |
| `amounts: List[float]` | NumericComparator @ 0.5 | NumericComparator @ 0.95 |
| `meta: dict` | ExactComparator @ 1.0 | ANLSStarComparator @ the model's `match_threshold` |

Expand Down