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

What is the difference between this ninja-schema and django-ninja model schema #12

Open
DrJfrost opened this issue Aug 3, 2024 · 4 comments

Comments

@DrJfrost
Copy link

DrJfrost commented Aug 3, 2024

As the title says I find a little redundant to recreate the modelchema

https://django-ninja.dev/guides/response/django-pydantic/ shouldn't the original django-ninja modelschema be used?

@eadwinCode
Copy link
Owner

@DrJfrost ninja-schema compiles to django model fields to pydantic fields with validations based on the field in question.
For example, an email field won't result to just a string type pydantic field but also a string type with email validation

@eadwinCode
Copy link
Owner

There are other features too if you check the readme.md

@DrJfrost
Copy link
Author

wouldn't it be better to extend the ninja's buitlin modelschema? from a large project perspective having to install 3 extra packages just to set up a rest api seems a bit too much. or at least make it part of the ninja-extra setup. if the project is oriented to be django friendly it should then inherently include all the tools in it. just like DRF does with views viewset's modelviewset etc

@eadwinCode
Copy link
Owner

@DrJfrost I think it's a good idea to move it into the django-ninja extra.
Thanks for the suggestions. It will be done in future releases of django-ninja extra

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

No branches or pull requests

2 participants