Skip to content

[Python] Add alpha TypedDict support #8800

@lmazuel

Description

@lmazuel

Add a model mode "typeddict" that would support some basic scenarios (at least for now)

Suppported:

  • Input only for TypedDict, output returns raw JSON is fine
  • Basic types (boolean, int, string)
  • Enum (generate the enum as usual, and put the type in the TypedDict)
  • Union (assuming all parts of the Union are in the supported list)
  • List and Dict
  • Operation treats that as if it receives a dict, and assume it's the correct JSON and send it to the pipeline

Not supported (refuse to generate)

  • Discriminator
  • Readonly
  • Datetime
  • Bytes
  • Extends record (additional properties)
  • Anything else that I don't list, since for now we really want a alpha support :)

CC @johanste

Metadata

Metadata

Assignees

Labels

emitter:client:pythonIssue for the Python client emitter: @typespec/http-client-pythonfeatureNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions