Skip to content

fix: recognize iso8601 and rfc822 as valid DateTime format aliases#1013

Merged
sloria merged 2 commits intomarshmallow-code:devfrom
karthiksai109:fix/recognize-iso8601-rfc822-datetime-format-aliases
Feb 13, 2026
Merged

fix: recognize iso8601 and rfc822 as valid DateTime format aliases#1013
sloria merged 2 commits intomarshmallow-code:devfrom
karthiksai109:fix/recognize-iso8601-rfc822-datetime-format-aliases

Conversation

@karthiksai109
Copy link
Contributor

Fixes #970

Marshmallow's DateTime field accepts both short and long format names
(iso/iso8601, rfc/rfc822) in its SERIALIZATION_FUNCS and
DESERIALIZATION_FUNCS. However, datetime2properties only checked for
the short forms, causing iso8601 and rfc822 to fall through to the
custom format branch — producing incorrect OpenAPI output.

  • iso8601 → was missing "format": "date-time", got "format": None
  • rfc822 → was missing the RFC pattern/example, got "format": None

Added the long-form aliases to the existing checks and tests for both.
Full test suite: 598 passed, 6 skipped.

karthiksai109 and others added 2 commits February 12, 2026 23:31
Fixes marshmallow-code#970

Marshmallow's DateTime field accepts both short and long format names
(iso/iso8601, rfc/rfc822) in its SERIALIZATION_FUNCS and
DESERIALIZATION_FUNCS. However, datetime2properties only checked for
the short forms, causing iso8601 and rfc822 to fall through to the
custom format branch  producing incorrect OpenAPI output (missing
date-time format for iso8601, missing pattern/example for rfc822).

This adds the long-form aliases to the existing checks so they produce
the same OpenAPI properties as their short-form equivalents.

Tests added for both iso8601 and rfc822 format values.
@sloria
Copy link
Member

sloria commented Feb 13, 2026

Thank you!

@sloria sloria enabled auto-merge (squash) February 13, 2026 14:39
@sloria sloria merged commit f767e75 into marshmallow-code:dev Feb 13, 2026
10 checks passed
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.

iso8601 format not detected correctly

2 participants