Skip to content
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

Add optional support for humantime Duration in poem Object #293

Merged
merged 2 commits into from
Jun 16, 2022

Conversation

banool
Copy link
Contributor

@banool banool commented Jun 15, 2022

I would love to be able to represent durations as part of the OpenAPI spec. As it is now you have to just make a field like "duration_secs" and trust the user will pass the value in as seconds. With this, you can instead get the rich parsing from humantime.

Naturally I made this an optional feature.

Tested with:

cargo test --features humantime

I see the other external types largely don't have tests so I didn't write specific tests for this either.

@sunli829
Copy link
Collaborator

sunli829 commented Jun 16, 2022

Thank you, please use nightly Rust to format the source:

cargo +nightly fmt --all

@sunli829 sunli829 merged commit 398659e into poem-web:master Jun 16, 2022
@sunli829
Copy link
Collaborator

Thanks 😊

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.

2 participants