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

Date strings are not converted to Date.t() automatically #17

Open
23Skidoo opened this issue Feb 4, 2022 · 1 comment · May be fixed by #21
Open

Date strings are not converted to Date.t() automatically #17

23Skidoo opened this issue Feb 4, 2022 · 1 comment · May be fixed by #21

Comments

@23Skidoo
Copy link

23Skidoo commented Feb 4, 2022

Current behaviour:

> ~D[2021-01-01] |> Jason.encode! |> Spect.to_spec!(Date)
** (Spect.ConvertError) expected: map, found: "\"2021-01-01\""
    (spect 0.4.1) lib/spect.ex:443: Spect.to_map!/4

Would be nice if it tried to convert the date string to a Date.t() instead of failing immediately.

@23Skidoo
Copy link
Author

The existing support for DateTime.t() doesn't work for literals either - only nested data, but doing the same for Date.t() would be enough for my use case.

@23Skidoo 23Skidoo linked a pull request Feb 17, 2022 that will close this issue
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 a pull request may close this issue.

1 participant