René's URL Explorer Experiment


Title: Allow "required" list to have undefined properties · Issue #97 · python-openapi/openapi-spec-validator · GitHub

Open Graph Title: Allow "required" list to have undefined properties · Issue #97 · python-openapi/openapi-spec-validator

X Title: Allow "required" list to have undefined properties · Issue #97 · python-openapi/openapi-spec-validator

Description: I think requiring property names listed in required to be defined in properties is too strict. I also couldn't find this requirement in the JSON Schema or OpenAPI specs. JSON Schema validators and the Swagger Editor are fine with propert...

Open Graph Description: I think requiring property names listed in required to be defined in properties is too strict. I also couldn't find this requirement in the JSON Schema or OpenAPI specs. JSON Schema validators and ...

X Description: I think requiring property names listed in required to be defined in properties is too strict. I also couldn't find this requirement in the JSON Schema or OpenAPI specs. JSON Schema validators ...

Opengraph URL: https://github.com/python-openapi/openapi-spec-validator/issues/97

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Allow \"required\" list to have undefined properties","articleBody":"I think requiring property names listed in `required` to be defined in `properties` is too strict. I also couldn't find this requirement in the JSON Schema or OpenAPI specs. JSON Schema validators and the Swagger Editor are fine with property names listed in `required` that are not defined in `properties`.\r\n\r\nIt makes sense to list required properties without defining them in `properties` when using `allOf` where one sub-schema requires some properties but does not specify them while another sub-schema only provides the specifications of the properties (possibly even without stating which ones are required and which ones aren't). This is especially useful when referencing and merging schema definitions or when expressing discriminated unions with some properties that are common to all union members.\r\n\r\nI suggest to remove the following code block\r\n\r\nhttps://github.com/p1c2u/openapi-spec-validator/blob/3f53e957812a9c545d71226e3a4d696240e2cee6/openapi_spec_validator/validators.py#L134-L142\r\n\r\nand the `require_properties` argument:\r\n\r\nhttps://github.com/p1c2u/openapi-spec-validator/blob/3f53e957812a9c545d71226e3a4d696240e2cee6/openapi_spec_validator/validators.py#L123\r\n\r\nI have seen the test case\r\n\r\nhttps://github.com/p1c2u/openapi-spec-validator/blob/3f53e957812a9c545d71226e3a4d696240e2cee6/tests/integration/test_validators.py#L83-L115\r\n\r\nbut it also seems to be valid to express this schema like this:\r\n\r\n```python\r\n{\r\n    'Credit': {\r\n        'type': 'object',\r\n        'properties': {\r\n            'clientId': {'type': 'string'},\r\n        }\r\n    },\r\n    'CreditCreate': {\r\n        'type': 'object',\r\n        'required': ['clientId'],\r\n        'allOf': [\r\n            {\r\n                '$ref': '#/components/schemas/Credit'\r\n            },\r\n            # possibly more schemas to merge ...\r\n        ]\r\n    }\r\n}\r\n```\r\n\r\nOr did I miss this rule somewhere in the spec?","author":{"url":"https://github.com/sisp","@type":"Person","name":"sisp"},"datePublished":"2020-08-03T16:34:09.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/97/openapi-spec-validator/issues/97"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:62ce4e6f-cd99-0b9d-b1a8-ebac6720ae82
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idAC82:87E17:22D43BD:2E0C9C2:696B0E1A
html-safe-noncecacde168b7bafbe8cdb3f39bdbfafb084abf04441728c3025da9154cf579814d
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQzgyOjg3RTE3OjIyRDQzQkQ6MkUwQzlDMjo2OTZCMEUxQSIsInZpc2l0b3JfaWQiOiI0MzgzNDI3MDU0MDgyMzk1Njc0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac5ea7f97b048fb804b3f56f18ce2c2229b357c5b9e054d588052e3f7fa7bd7fbe
hovercard-subject-tagissue:672199386
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/python-openapi/openapi-spec-validator/97/issue_layout
twitter:imagehttps://opengraph.githubassets.com/f88cc3ee16ab567ce7ecd80f55221e4685ffad83fba424a686d50872cd9443c6/python-openapi/openapi-spec-validator/issues/97
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/f88cc3ee16ab567ce7ecd80f55221e4685ffad83fba424a686d50872cd9443c6/python-openapi/openapi-spec-validator/issues/97
og:image:altI think requiring property names listed in required to be defined in properties is too strict. I also couldn't find this requirement in the JSON Schema or OpenAPI specs. JSON Schema validators and ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamesisp
hostnamegithub.com
expected-hostnamegithub.com
None5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d
turbo-cache-controlno-preview
go-importgithub.com/python-openapi/openapi-spec-validator git https://github.com/python-openapi/openapi-spec-validator.git
octolytics-dimension-user_id126442889
octolytics-dimension-user_loginpython-openapi
octolytics-dimension-repository_id102581313
octolytics-dimension-repository_nwopython-openapi/openapi-spec-validator
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id102581313
octolytics-dimension-repository_network_root_nwopython-openapi/openapi-spec-validator
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
release82560a55c6b2054555076f46e683151ee28a19bc
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python-openapi/openapi-spec-validator/issues/97#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-openapi%2Fopenapi-spec-validator%2Fissues%2F97
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
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
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://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/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-openapi%2Fopenapi-spec-validator%2Fissues%2F97
Sign up https://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=python-openapi%2Fopenapi-spec-validator
Reloadhttps://github.com/python-openapi/openapi-spec-validator/issues/97
Reloadhttps://github.com/python-openapi/openapi-spec-validator/issues/97
Reloadhttps://github.com/python-openapi/openapi-spec-validator/issues/97
python-openapi https://github.com/python-openapi
openapi-spec-validatorhttps://github.com/python-openapi/openapi-spec-validator
Please reload this pagehttps://github.com/python-openapi/openapi-spec-validator/issues/97
Notifications https://github.com/login?return_to=%2Fpython-openapi%2Fopenapi-spec-validator
Fork 70 https://github.com/login?return_to=%2Fpython-openapi%2Fopenapi-spec-validator
Star 384 https://github.com/login?return_to=%2Fpython-openapi%2Fopenapi-spec-validator
Code https://github.com/python-openapi/openapi-spec-validator
Issues 46 https://github.com/python-openapi/openapi-spec-validator/issues
Pull requests 9 https://github.com/python-openapi/openapi-spec-validator/pulls
Discussions https://github.com/python-openapi/openapi-spec-validator/discussions
Actions https://github.com/python-openapi/openapi-spec-validator/actions
Projects 0 https://github.com/python-openapi/openapi-spec-validator/projects
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/python-openapi/openapi-spec-validator/security
Please reload this pagehttps://github.com/python-openapi/openapi-spec-validator/issues/97
Insights https://github.com/python-openapi/openapi-spec-validator/pulse
Code https://github.com/python-openapi/openapi-spec-validator
Issues https://github.com/python-openapi/openapi-spec-validator/issues
Pull requests https://github.com/python-openapi/openapi-spec-validator/pulls
Discussions https://github.com/python-openapi/openapi-spec-validator/discussions
Actions https://github.com/python-openapi/openapi-spec-validator/actions
Projects https://github.com/python-openapi/openapi-spec-validator/projects
Security https://github.com/python-openapi/openapi-spec-validator/security
Insights https://github.com/python-openapi/openapi-spec-validator/pulse
New issuehttps://github.com/login?return_to=https://github.com/python-openapi/openapi-spec-validator/issues/97
New issuehttps://github.com/login?return_to=https://github.com/python-openapi/openapi-spec-validator/issues/97
Allow "required" list to have undefined propertieshttps://github.com/python-openapi/openapi-spec-validator/issues/97#top
https://github.com/sisp
https://github.com/sisp
sisphttps://github.com/sisp
on Aug 3, 2020https://github.com/python-openapi/openapi-spec-validator/issues/97#issue-672199386
https://github.com/p1c2u/openapi-spec-validator/blob/3f53e957812a9c545d71226e3a4d696240e2cee6/openapi_spec_validator/validators.py#L134-L142https://github.com/p1c2u/openapi-spec-validator/blob/3f53e957812a9c545d71226e3a4d696240e2cee6/openapi_spec_validator/validators.py#L134-L142
https://github.com/p1c2u/openapi-spec-validator/blob/3f53e957812a9c545d71226e3a4d696240e2cee6/openapi_spec_validator/validators.py#L123https://github.com/p1c2u/openapi-spec-validator/blob/3f53e957812a9c545d71226e3a4d696240e2cee6/openapi_spec_validator/validators.py#L123
https://github.com/p1c2u/openapi-spec-validator/blob/3f53e957812a9c545d71226e3a4d696240e2cee6/tests/integration/test_validators.py#L83-L115https://github.com/p1c2u/openapi-spec-validator/blob/3f53e957812a9c545d71226e3a4d696240e2cee6/tests/integration/test_validators.py#L83-L115
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.