Skip to content

Conversation

@blast-hardcheese
Copy link
Contributor

Why

Follow-up to #72 to account for schema.json files without metadata.

What changed

If the handshakeSchema field is defined, then the parameter is required. Otherwise, the parameter is Literal[None], which matches the previous behavior of the default.

Due to the metadata field now being required, I had to remove the = None default parameter. I think this is alright.

It'll mean that #73 will likely need to change to handshake_metadata_factory: HandshakeType | Callable[[], Awaitable[HandshakeType]] to avoid async def stub() -> None: return None just to satisfy the async requirement. It's somewhat challenging to capture the exact semantics we want here, but I think that's alright.

Test plan

Do typechecks pass?

@blast-hardcheese blast-hardcheese requested a review from a team as a code owner August 20, 2024 23:57
@blast-hardcheese blast-hardcheese requested review from jackyzha0 and removed request for a team August 20, 2024 23:57
@blast-hardcheese blast-hardcheese force-pushed the dstewart/chore/schema-handshakeMetadata-pt2 branch from ca437f5 to 9c1ebbc Compare August 20, 2024 23:58
@blast-hardcheese blast-hardcheese merged commit 7062bf6 into main Aug 26, 2024
@blast-hardcheese blast-hardcheese deleted the dstewart/chore/schema-handshakeMetadata-pt2 branch August 26, 2024 19:56
@blast-hardcheese blast-hardcheese added the enhancement New feature or request label Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants