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

Failed to parse DateTime #632

Closed
gan-of-culture opened this issue Aug 26, 2023 · 2 comments
Closed

Failed to parse DateTime #632

gan-of-culture opened this issue Aug 26, 2023 · 2 comments
Labels
question Further information is requested

Comments

@gan-of-culture
Copy link

gan-of-culture commented Aug 26, 2023

Expected Behavior

Parsing of DateTime Object like 2023-09-29T00:00:00+09:00

Actual Behavior

Does not parse successfully
Error message:
parse request payload error: failed to parse "string(date-time)": premature end of input (occurred while parsing "testStruct") (occurred while parsing "testStruct1")

Error appears when using the rust type chrono::DateTimechrono::Utc as part of a struct.

see also #436

@gan-of-culture gan-of-culture added the question Further information is requested label Aug 26, 2023
@gan-of-culture
Copy link
Author

I thought it has to be in this format https://docs.rs/chrono/latest/chrono/struct.DateTime.html#impl-FromStr-for-DateTime%3CUtc%3E but it doesn't work.

@sunli829 any idea how to fix this issue?

@gan-of-culture
Copy link
Author

It works... I have a structure with two fields of type chrono::DateTimechrono::Utc. In the SwaggerUI the date is represented as "" if left empty. This value cannot be parsed and throws the error. So you have to pass a valid date either way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant