Skip to content

DatetimeInterval pydantic model doesn't support open-ended date ranges #99

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
phil-osk opened this issue Apr 17, 2025 · 0 comments · May be fixed by #100
Open

DatetimeInterval pydantic model doesn't support open-ended date ranges #99

phil-osk opened this issue Apr 17, 2025 · 0 comments · May be fixed by #100
Labels
[package] stapi-pydantic Pydantic models for STAPI data structures

Comments

@phil-osk
Copy link
Contributor

Per the the opportunity spec and order spec, dateinterval should support open-ended date ranges where .. represents an open end (e.g., ../20250101, 20250101/..) as specced in RFC 3339.

Pydantic model is:
DatetimeInterval = Annotated[ tuple[AwareDatetime, AwareDatetime], BeforeValidator(validate_before), AfterValidator(validate_after), WrapSerializer(serialize, return_type=str), WithJsonSchema({"type": "string"}, mode="serialization"), ]

AwareDateTime does not allow for None or other representation that an item in the tuple does not exist.

@phil-osk phil-osk added the [package] stapi-pydantic Pydantic models for STAPI data structures label Apr 17, 2025
@phil-osk phil-osk linked a pull request Apr 18, 2025 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[package] stapi-pydantic Pydantic models for STAPI data structures
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant