René's URL Explorer Experiment


Title: SQLModel doesn't raise ValidationError · Issue #52 · fastapi/sqlmodel · GitHub

Open Graph Title: SQLModel doesn't raise ValidationError · Issue #52 · fastapi/sqlmodel

X Title: SQLModel doesn't raise ValidationError · Issue #52 · fastapi/sqlmodel

Description: First Check I added a very descriptive title to this issue. I used the GitHub search to find a similar issue and didn't find it. I searched the SQLModel documentation, with the integrated search. I already searched in Google "How to X in...

Open Graph Description: First Check I added a very descriptive title to this issue. I used the GitHub search to find a similar issue and didn't find it. I searched the SQLModel documentation, with the integrated search. I...

X Description: First Check I added a very descriptive title to this issue. I used the GitHub search to find a similar issue and didn't find it. I searched the SQLModel documentation, with the integrated searc...

Opengraph URL: https://github.com/fastapi/sqlmodel/issues/52

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"SQLModel doesn't raise ValidationError","articleBody":"### First Check\n\n- [X] I added a very descriptive title to this issue.\n- [X] I used the GitHub search to find a similar issue and didn't find it.\n- [X] I searched the SQLModel documentation, with the integrated search.\n- [X] I already searched in Google \"How to X in SQLModel\" and didn't find any information.\n- [X] I already read and followed all the tutorial in the docs and didn't find an answer.\n- [X] I already checked if it is not related to SQLModel but to [Pydantic](https://github.com/samuelcolvin/pydantic).\n- [X] I already checked if it is not related to SQLModel but to [SQLAlchemy](https://github.com/sqlalchemy/sqlalchemy).\n\n### Commit to Help\n\n- [X] I commit to help with one of those options 👆\n\n### Example Code\n\n```python\nfrom typing import Optional\r\n\r\nfrom pydantic import BaseModel\r\nfrom sqlmodel import Field, SQLModel\r\n\r\nclass User1(SQLModel, table=True):\r\n    id: Optional[int] = Field(primary_key=True)\r\n    name: str\r\n\r\nclass User2(BaseModel):\r\n    name: str\r\n\r\nUser1()\r\nUser2()\n```\n\n\n### Description\n\n* Create SQLModel\r\n* Create equivalent pydantic model\r\n* Create instance of SQLModel without providing required arguments\r\n* Create instance of pydantic model without providing required arguments \r\n\r\nThe pydantic model raises an ValidationError whereas the SQLModel doesn't raise a ValidationError even though an required argument is not provided. I would expect a ValidationError if not all required arguments is provided.\n\n### Operating System\n\nmacOS\n\n### Operating System Details\n\n_No response_\n\n### SQLModel Version\n\n0.0.4\n\n### Python Version\n\nPython 3.8.5\n\n### Additional Context\n\n_No response_","author":{"url":"https://github.com/elben10","@type":"Person","name":"elben10"},"datePublished":"2021-08-28T12:22:40Z","url":"https://github.com/fastapi/sqlmodel/issues/52"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:8c4370e5-00a0-2f55-c556-a1aad9e8c4ef
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA962:2C6DBB:78EE67:A6D85E:6AFDF1CD
html-safe-nonce979587f7ba942bcfbec27c0583661dd5d3c8a5d83836fa5a5fea72ac39132eb4
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOTYyOjJDNkRCQjo3OEVFNjc6QTZEODVFOjZBRkRGMUNEIiwidmlzaXRvcl9pZCI6IjQ4ODM2NjM2NDc0MjA1NzYyMDUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacebb28c29cd556dcafcde27c2ed6615be540bedcaf97b38b882a5994b01261898
hovercard-subject-tagissue:981822256
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/fastapi/sqlmodel/52/issue_layout
twitter:imagehttps://opengraph.githubassets.com/8d95d6e3ce437a59ec93ca8813de2a7f90fa017dc59f880551d913e8200f2b7a/fastapi/sqlmodel/issues/52
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/8d95d6e3ce437a59ec93ca8813de2a7f90fa017dc59f880551d913e8200f2b7a/fastapi/sqlmodel/issues/52
og:image:altFirst Check I added a very descriptive title to this issue. I used the GitHub search to find a similar issue and didn't find it. I searched the SQLModel documentation, with the integrated search. I...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameelben10
hostnamegithub.com
expected-hostnamegithub.com
Nonedd812ec581ecac95855f5ec917ef9827506c39a9da1443f43ddb4179a46471eb
turbo-cache-controlno-preview
go-importgithub.com/fastapi/sqlmodel git https://github.com/fastapi/sqlmodel.git
octolytics-dimension-user_id156354296
octolytics-dimension-user_loginfastapi
octolytics-dimension-repository_id399495186
octolytics-dimension-repository_nwofastapi/sqlmodel
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id399495186
octolytics-dimension-repository_network_root_nwofastapi/sqlmodel
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release32ac708bac264dafdc28e10ff49b4d137f0c34a7
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/fastapi/sqlmodel/issues/52#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ffastapi%2Fsqlmodel%2Fissues%2F52
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ffastapi%2Fsqlmodel%2Fissues%2F52
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=fastapi%2Fsqlmodel
Reloadhttps://github.com/fastapi/sqlmodel/issues/52
Reloadhttps://github.com/fastapi/sqlmodel/issues/52
Reloadhttps://github.com/fastapi/sqlmodel/issues/52
fastapihttps://github.com/fastapi
sqlmodelhttps://github.com/fastapi/sqlmodel
Codehttps://github.com/fastapi/sqlmodel
Issues1 (1)https://github.com/fastapi/sqlmodel/issues
Pull requests53 (53)https://github.com/fastapi/sqlmodel/pulls
Discussionshttps://github.com/fastapi/sqlmodel/discussions
Actionshttps://github.com/fastapi/sqlmodel/actions
Projectshttps://github.com/fastapi/sqlmodel/projects
Security and qualityhttps://github.com/fastapi/sqlmodel/security
Insightshttps://github.com/fastapi/sqlmodel/insights
https://github.com/fastapi/sqlmodel
New issuehttps://github.com/login?return_to=https://github.com/fastapi/sqlmodel/issues/52
New issuehttps://github.com/login?return_to=https://github.com/fastapi/sqlmodel/issues/52
SQLModel doesn't raise ValidationErrorhttps://github.com/fastapi/sqlmodel/issues/52#top
answeredhttps://github.com/fastapi/sqlmodel/issues?q=state%3Aopen%20label%3A%22answered%22
questionFurther information is requestedhttps://github.com/fastapi/sqlmodel/issues?q=state%3Aopen%20label%3A%22question%22
https://github.com/elben10
elben10https://github.com/elben10
on Aug 28, 2021https://github.com/fastapi/sqlmodel/issues/52#issue-981822256
Pydantichttps://github.com/samuelcolvin/pydantic
SQLAlchemyhttps://github.com/sqlalchemy/sqlalchemy
Nexthttps://github.com/fastapi/sqlmodel/issues/52?timeline_page=1
elben10https://github.com/elben10
questionFurther information is requestedhttps://github.com/fastapi/sqlmodel/issues?q=state%3Aopen%20label%3A%22question%22
on Aug 28, 2021https://github.com/fastapi/sqlmodel/issues/52#event-5221672917
https://github.com/obassett
obassetthttps://github.com/obassett
on Aug 28, 2021https://github.com/fastapi/sqlmodel/issues/52#issuecomment-907621135
https://github.com/sathoune
sathounehttps://github.com/sathoune
on Aug 28, 2021https://github.com/fastapi/sqlmodel/issues/52#issuecomment-907669780
https://github.com/maku2903
maku2903https://github.com/maku2903
on Aug 28, 2021https://github.com/fastapi/sqlmodel/issues/52#issuecomment-907688821
https://github.com/obassett
obassetthttps://github.com/obassett
on Aug 30, 2021https://github.com/fastapi/sqlmodel/issues/52#issuecomment-907919772
https://github.com/SunsetOrange
SunsetOrangehttps://github.com/SunsetOrange
on Sep 1, 2021https://github.com/fastapi/sqlmodel/issues/52#issuecomment-909873450
@obassetthttps://github.com/obassett
https://github.com/lovetoburnswhen
lovetoburnswhenhttps://github.com/lovetoburnswhen
on Sep 1, 2021https://github.com/fastapi/sqlmodel/issues/52#issuecomment-910605984
herehttps://sqlmodel.tiangolo.com/tutorial/relationship-attributes/create-and-update-relationships/#create-instances-with-relationship-attributes
https://github.com/alexferrari88
alexferrari88https://github.com/alexferrari88
on Oct 10, 2021https://github.com/fastapi/sqlmodel/issues/52#issuecomment-939445901
https://sqlmodel.tiangolo.com/tutorial/fastapi/multiple-models/https://sqlmodel.tiangolo.com/tutorial/fastapi/multiple-models/
https://sqlmodel.tiangolo.com/tutorial/fastapi/relationships/https://sqlmodel.tiangolo.com/tutorial/fastapi/relationships/
https://github.com/memark
memarkhttps://github.com/memark
on Feb 6, 2022https://github.com/fastapi/sqlmodel/issues/52#issuecomment-1030869133
@tiangolohttps://github.com/tiangolo
https://github.com/andremmori
andremmorihttps://github.com/andremmori
on Aug 24, 2022https://github.com/fastapi/sqlmodel/issues/52#issuecomment-1225746421
https://github.com/memark
memarkhttps://github.com/memark
on Sep 10, 2022https://github.com/fastapi/sqlmodel/issues/52#issuecomment-1242759488
@andremmorihttps://github.com/andremmori
https://github.com/will-afs
will-afshttps://github.com/will-afs
on Sep 19, 2022https://github.com/fastapi/sqlmodel/issues/52#issuecomment-1251268145
@andremmorihttps://github.com/andremmori
https://github.com/phi-friday
phi-fridayhttps://github.com/phi-friday
on Oct 1, 2022https://github.com/fastapi/sqlmodel/issues/52#issuecomment-1264420636
https://github.com/andremmori
andremmorihttps://github.com/andremmori
on Oct 3, 2022https://github.com/fastapi/sqlmodel/issues/52#issuecomment-1264905463
@andremmorihttps://github.com/andremmori
herehttps://pydantic-docs.helpmanual.io/usage/model_config/#options
#227https://github.com/fastapi/sqlmodel/pull/227
https://github.com/oyvinev
oyvinevhttps://github.com/oyvinev
on Oct 6, 2022https://github.com/fastapi/sqlmodel/issues/52#issuecomment-1269562752
@andremmorihttps://github.com/andremmori
https://github.com/sawyna
sawynahttps://github.com/sawyna
on Aug 1, 2025https://github.com/fastapi/sqlmodel/issues/52#issuecomment-3143812615
@jeremylloydhttps://github.com/jeremylloyd
https://github.com/jeremylloyd
jeremylloydhttps://github.com/jeremylloyd
on Aug 2, 2025https://github.com/fastapi/sqlmodel/issues/52#issuecomment-3146403350
@samweisgamdschiehttps://github.com/samweisgamdschie
my comment's conclusionhttps://github.com/fastapi/sqlmodel/issues/52#issuecomment-3124241267
https://github.com/TyronMYoung11
TyronMYoung11https://github.com/TyronMYoung11
on Aug 3, 2025https://github.com/fastapi/sqlmodel/issues/52#issuecomment-3148118360
https://github.com/spandan-sharma
spandan-sharmahttps://github.com/spandan-sharma
on Sep 2, 2025https://github.com/fastapi/sqlmodel/issues/52#issuecomment-3244702008
the inithttps://github.com/fastapi/sqlmodel/blob/55abec9a9cd04f260d836726a63b96ba351ae74d/sqlmodel/main.py#L814
it eventually sets all the attributeshttps://github.com/fastapi/sqlmodel/blob/55abec9a9cd04f260d836726a63b96ba351ae74d/sqlmodel/_compat.py#L281
@espdevhttps://github.com/espdev
saw this behaviourhttps://github.com/fastapi/sqlmodel/issues/52#issuecomment-2372511953
when it gathers all the values to sethttps://github.com/fastapi/sqlmodel/blob/55abec9a9cd04f260d836726a63b96ba351ae74d/sqlmodel/_compat.py#L263
the pydantic validatorhttps://github.com/fastapi/sqlmodel/blob/55abec9a9cd04f260d836726a63b96ba351ae74d/sqlmodel/_compat.py#L328
then assigns all attributes one by one againhttps://github.com/fastapi/sqlmodel/blob/55abec9a9cd04f260d836726a63b96ba351ae74d/sqlmodel/_compat.py#L344
internally calls inithttps://github.com/fastapi/sqlmodel/blob/55abec9a9cd04f260d836726a63b96ba351ae74d/sqlmodel/_compat.py#L318
https://github.com/bjmc
bjmchttps://github.com/bjmc
on Oct 2, 2025https://github.com/fastapi/sqlmodel/issues/52#issuecomment-3361717004
#1041https://github.com/fastapi/sqlmodel/pull/1041
like thishttps://sqlmodel.tiangolo.com/#sqlalchemy-and-pydantic
https://github.com/MarleTangible
MarleTangiblehttps://github.com/MarleTangible
on Jan 6, 2026https://github.com/fastapi/sqlmodel/issues/52#issuecomment-3715363197
@bjmchttps://github.com/bjmc
statementhttps://sqlmodel.tiangolo.com/#sqlalchemy-and-pydantic
https://github.com/TyronMYoung11
TyronMYoung11https://github.com/TyronMYoung11
on Jan 7, 2026https://github.com/fastapi/sqlmodel/issues/52#issuecomment-3717828824
https://github.com/GLeurquin
GLeurquinhttps://github.com/GLeurquin
on Jan 14, 2026https://github.com/fastapi/sqlmodel/issues/52#issuecomment-3749498063
https://github.com/MarleTangible
MarleTangiblehttps://github.com/MarleTangible
on Jan 14, 2026https://github.com/fastapi/sqlmodel/issues/52#issuecomment-3749525697
@GLeurquinhttps://github.com/GLeurquin
https://github.com/milescluce
milesclucehttps://github.com/milescluce
on Feb 6, 2026https://github.com/fastapi/sqlmodel/issues/52#issuecomment-3857089381
@MarleTangiblehttps://github.com/MarleTangible
https://github.com/MarleTangible
MarleTangiblehttps://github.com/MarleTangible
on Feb 10, 2026https://github.com/fastapi/sqlmodel/issues/52#issuecomment-3880824664
@milesclucehttps://github.com/milescluce
https://github.com/YuriiMotov
YuriiMotovhttps://github.com/YuriiMotov
on Feb 11, 2026https://github.com/fastapi/sqlmodel/issues/52#issuecomment-3882593595
https://sqlmodel.tiangolo.com/tutorial/fastapi/multiple-models/#multiple-models-with-inheritancehttps://sqlmodel.tiangolo.com/tutorial/fastapi/multiple-models/#multiple-models-with-inheritance
apiwat-chantawibulhttps://github.com/apiwat-chantawibul
on Feb 15, 2026https://github.com/fastapi/sqlmodel/issues/52#event-22809900177
check if pydantic validation is workinghttps://github.com/2026-Q1-Team/fishing-smile/commit/1d93c8c922192efd0fa5396ef052d4b3218fae31
1d93c8chttps://github.com/2026-Q1-Team/fishing-smile/commit/1d93c8c922192efd0fa5396ef052d4b3218fae31
https://github.com/ZougaRida
ZougaRidahttps://github.com/ZougaRida
on Apr 4, 2026https://github.com/fastapi/sqlmodel/issues/52#issuecomment-4187304199
@spandan-sharmahttps://github.com/spandan-sharma
helperbot-recidivizhttps://github.com/helperbot-recidiviz
on Jul 7, 2026https://github.com/fastapi/sqlmodel/issues/52#event-27641175822
[Reentry] Sanitize the markdown against bad HTML (Recidiviz/recidiviz…https://github.com/Recidiviz/pulse-dashboards/commit/c8854bd1ed13dcf14d27e4886a7875698c77889e
c8854bdhttps://github.com/Recidiviz/pulse-dashboards/commit/c8854bd1ed13dcf14d27e4886a7875698c77889e
Sign up for freehttps://github.com/signup?return_to=https://github.com/fastapi/sqlmodel/issues/52
Sign in to commenthttps://github.com/login?return_to=https://github.com/fastapi/sqlmodel/issues/52
answeredhttps://github.com/fastapi/sqlmodel/issues?q=state%3Aopen%20label%3A%22answered%22
questionFurther information is requestedhttps://github.com/fastapi/sqlmodel/issues?q=state%3Aopen%20label%3A%22question%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.