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

Allow the codegen to emit the null type #37

Merged
merged 1 commit into from
Jul 2, 2024
Merged

Conversation

lhchavez
Copy link
Contributor

@lhchavez lhchavez commented Jul 2, 2024

Why

Some types have an explicit Type.Null() (as opposed to a Type.Optional). That's allowed by the spec, so we should support it.

What changed

This change now correctly codegens Type.Null() (or in JSON-schema parlance, "type": "null") into Python's None type.

Test plan

Amended the python file for this in the poetry venv, generating the latest and greatest pid2 schema succeeded.

Some types have an explicit `Type.Null()` (as opposed to a
`Type.Optional`). That's allowed by the spec, so we should support it.

This change now correctly codegens `Type.Null()` (or in JSON-schema
parlance, `"type": "null"`) into Python's `None` type.
@lhchavez lhchavez enabled auto-merge (squash) July 2, 2024 16:47
@lhchavez lhchavez merged commit 419be87 into main Jul 2, 2024
1 check passed
@lhchavez lhchavez deleted the lh-codegen-null branch July 2, 2024 16:58
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

Successfully merging this pull request may close these issues.

2 participants