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 conversions for types that support popular string formats #318

Closed
mwadams opened this issue Mar 19, 2024 · 1 comment
Closed

Add conversions for types that support popular string formats #318

mwadams opened this issue Mar 19, 2024 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@mwadams
Copy link
Contributor

mwadams commented Mar 19, 2024

If a schema supports one of the common string formats, then it would be useful to support conversions to the relevant concrete string format types (e.g. JsonUriTemplate, JsonUuid).

At the moment it will (of course) convert with an As<T>()-type cast, but there is no intellisense/type hint that this is possible.

@mwadams mwadams added the enhancement New feature or request label Mar 19, 2024
@mwadams mwadams added this to the VNext milestone Jul 23, 2024
@mwadams mwadams linked a pull request Aug 1, 2024 that will close this issue
mwadams added a commit that referenced this issue Aug 8, 2024
1. This allows us to eliminate the last of the T4 templates
2. This dogfoods our codegen - the specs that test the non-validation capabilities of the core types become tests for our generated code as well as the core types themselves.

- Adding code generation for all of the "format" extensions using the existing IFormatHandler (renamed from IFormatProvider)
- This also fixes #318
- Implemented custom span-based parsers for OffsetDateTime, LocalDate, OffsetTime so they become zero-allocation allowing implicit casts to those types.
- Optimized non-span/string-based parsing of netstandard2.0 IPAddress (v4/v6) and UUID.
@mwadams
Copy link
Contributor Author

mwadams commented Aug 12, 2024

Fixed in #393 - please try the Preview packages on nuget.

@mwadams mwadams closed this as completed Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant