Skip to content

FutureWarning ahead of the 'required' default flip (#12) - #35

Merged
thorwhalen merged 1 commit into
masterfrom
required-future-warning
Dec 6, 2026
Merged

thorwhalen merged 1 commit into
masterfrom
required-future-warning

Conversation

@thorwhalen

Copy link
Copy Markdown
Member

Refs #12 (first of two steps; the issue stays open for the flip)

Per the recommendation on the issue: announce first, flip in a later release. json_schema_to_signature now emits a FutureWarning when a properties schema has no required key and at least one property has no default of its own, i.e. exactly when the flip to JSON Schema semantics (nothing required, optional parameters ordered after required ones) would change the signature. Behaviour is otherwise unchanged. The warning names the remedy ('required': [...], or []), is attributed to the caller (stacklevel=3), and is silent when nothing would change. The docstring documents the planned flip.

Changelog note: next release flips the default; add an explicit required list to keep today's signature.

Gate: pytest --doctest-modules ju: 133 passed, 3 skipped. Review: small, own careful read. Not run: the dependents test gate (priv test-dependents ju), reserved for the flip PR; in-repo callers (ju.oas) only gain a warning.

@thorwhalen
thorwhalen merged commit 3150de0 into master Dec 6, 2026
34 checks passed
@thorwhalen
thorwhalen deleted the required-future-warning branch December 6, 2026 01:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant