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

Make FormFrom a separate crate. #2516

Closed
Tomperez98 opened this issue Apr 10, 2023 · 2 comments
Closed

Make FormFrom a separate crate. #2516

Tomperez98 opened this issue Apr 10, 2023 · 2 comments
Labels
suggestion A suggestion to change functionality

Comments

@Tomperez98
Copy link

Existing Functionality

Currently, the trait FromForm is part of the API framework. But the data validation functionality comes really handy for other types of applications such as (CLI) applications.

Suggested Changes

Move the FromForm trait a a separate crate so the logic can be used for different types of applications, other than APIs.

This would be similar to the core functionality Pydantic provides. Pydantic + FastAPI is a great combination, but the validation logic Pydantic provides can be used even if FastAPI is not installed

@Tomperez98 Tomperez98 added the suggestion A suggestion to change functionality label Apr 10, 2023
@Tomperez98
Copy link
Author

Maybe this covers it.

https://github.com/Keats/validator

@SergioBenitez
Copy link
Member

SergioBenitez commented Apr 11, 2023

The FromForm trait is very specific to Rocket. The validation parts are somewhat specific to Rocket but could be extracted out. I think that would be great, but doing so isn't really within the scope of the Rocket project itself, so I'm closing this issue. Feel free (of course!) to take any of the code and transform it into an external crate!

Also see #1915.

@SergioBenitez SergioBenitez closed this as not planned Won't fix, can't repro, duplicate, stale Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
suggestion A suggestion to change functionality
Projects
None yet
Development

No branches or pull requests

2 participants