René's URL Explorer Experiment


Title: validation(openapi-3.1.0) - nullable enums? · Issue #378 · python-openapi/openapi-spec-validator · GitHub

Open Graph Title: validation(openapi-3.1.0) - nullable enums? · Issue #378 · python-openapi/openapi-spec-validator

X Title: validation(openapi-3.1.0) - nullable enums? · Issue #378 · python-openapi/openapi-spec-validator

Description: I have in an external projects some problems with the openapi-spec-validator. In our project, we happen to generate an property that either has a value from an enum, or can be null. See: master...kazie:openapi-spec-validator:test/test-wi...

Open Graph Description: I have in an external projects some problems with the openapi-spec-validator. In our project, we happen to generate an property that either has a value from an enum, or can be null. See: master...k...

X Description: I have in an external projects some problems with the openapi-spec-validator. In our project, we happen to generate an property that either has a value from an enum, or can be null. See: master...k...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"validation(openapi-3.1.0) - nullable enums?","articleBody":"I have in an external projects some problems with the openapi-spec-validator.\r\n\r\nIn our project, we happen to generate an property that either has a value from an `enum`, or can be `null.`\r\n\r\nSee: https://github.com/python-openapi/openapi-spec-validator/compare/master...kazie:openapi-spec-validator:test/test-with-enum-string-or-null-property\r\n\r\nI would believe this is valid OpenAPI specification for a field, but the validation fails, as from this project fork when running test:\r\n\r\n```python\r\nopenapi_spec_validator/shortcuts.py:48: in validate\r\n    return v.validate()\r\n        base_uri   = 'file:///home/kazie/src/github/openapi-spec-validator/tests/integration/data/v3.1/petstore.yaml'\r\n        cls        = \u003cclass 'openapi_spec_validator.validation.validators.OpenAPIV31SpecValidator'\u003e\r\n        sp         = SchemaPath('')\r\n        spec       = {'components': {'pathItems': {'PetPath': {'get': {'operationId': 'showPetById', 'parameters': [{...}], 'responses': {'...r'}}, 'summary': 'Create a pet', 'tags': ['pets']}}, '/pets/{petId}': {'$ref': '#/components/pathItems/PetPath'}}, ...}\r\n        v          = \u003copenapi_spec_validator.validation.validators.OpenAPIV31SpecValidator object at 0x782454500440\u003e\r\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \r\n\r\nself = \u003copenapi_spec_validator.validation.validators.OpenAPIV31SpecValidator object at 0x782454500440\u003e\r\n\r\n    def validate(self) -\u003e None:\r\n        for err in self.iter_errors():\r\n\u003e           raise err\r\nE           openapi_spec_validator.validation.exceptions.OpenAPIValidationError: None is not one of ['ALIVE', 'DEAD']\r\nE           \r\nE           Failed validating 'enum' in schema:\r\nE               {'default': None,\r\nE                'description': 'The status of the pet. `null` if current status can '\r\nE                               'not be confirmed.',\r\nE                'enum': ['ALIVE', 'DEAD'],\r\nE                'example': 'ALIVE',\r\nE                'type': ['string', 'null']}\r\nE           \r\nE           On instance:\r\nE               None\r\n\r\nerr        = \u003cOpenAPIValidationError: \"None is not one of ['ALIVE', 'DEAD']\"\u003e\r\nself       = \u003copenapi_spec_validator.validation.validators.OpenAPIV31SpecValidator object at 0x782454500440\u003e\r\n\r\nopenapi_spec_validator/validation/validators.py:71: OpenAPIValidationError\r\n```\r\n\r\nIt is true that `None` is not in the enum `[ ALIVE, DEAD ]`, but it is in the type array as `['string', 'null']` \r\n\r\n---\r\n\r\nSo, do you believe that my specification is just invalid, or do we have a bug on our hands in the validation here? :sweat_smile: \r\n\r\nI came to this when migrating from `OpenAPI 3.0.3` where we migrate from having `nullable: true` into these type arrays.","author":{"url":"https://github.com/kazie","@type":"Person","name":"kazie"},"datePublished":"2024-11-19T16:10:37.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/378/openapi-spec-validator/issues/378"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:d621531f-7ec9-f10e-d43d-dd57c5fdd143
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idCA00:21AC08:16E5F8:1FE61D:696A6C77
html-safe-noncef351111ea6502d561cba74d0a77f87551d319b876708fa3ee41285b0056e4c7e
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQTAwOjIxQUMwODoxNkU1Rjg6MUZFNjFEOjY5NkE2Qzc3IiwidmlzaXRvcl9pZCI6Ijc3MDExODU4ODg5MDQ3MDMwOTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac7206650018a275614c3af81264a739c27c1ef1a1dc15c05bac16d870b65be9cc
hovercard-subject-tagissue:2672721890
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/378/issue_layout
twitter:imagehttps://opengraph.githubassets.com/1ce40ebb56fd9196442769445e8ae73715e755170801929d6d51030322a7443c/python-openapi/openapi-spec-validator/issues/378
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/1ce40ebb56fd9196442769445e8ae73715e755170801929d6d51030322a7443c/python-openapi/openapi-spec-validator/issues/378
og:image:altI have in an external projects some problems with the openapi-spec-validator. In our project, we happen to generate an property that either has a value from an enum, or can be null. See: master...k...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamekazie
hostnamegithub.com
expected-hostnamegithub.com
None6fea32d5b7276b841b7a803796d9715bc6cfb31ed549fdf9de2948ac25d12ba6
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
releasef2d9f6432a5a115ec709295ae70623f33bb80aee
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python-openapi/openapi-spec-validator/issues/378#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%2F378
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%2F378
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/378
Reloadhttps://github.com/python-openapi/openapi-spec-validator/issues/378
Reloadhttps://github.com/python-openapi/openapi-spec-validator/issues/378
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/378
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/378
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/378
New issuehttps://github.com/login?return_to=https://github.com/python-openapi/openapi-spec-validator/issues/378
validation(openapi-3.1.0) - nullable enums?https://github.com/python-openapi/openapi-spec-validator/issues/378#top
https://github.com/kazie
https://github.com/kazie
kaziehttps://github.com/kazie
on Nov 19, 2024https://github.com/python-openapi/openapi-spec-validator/issues/378#issue-2672721890
master...kazie:openapi-spec-validator:test/test-with-enum-string-or-null-propertyhttps://github.com/python-openapi/openapi-spec-validator/compare/master...kazie:openapi-spec-validator:test/test-with-enum-string-or-null-property
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.