Skip to content

[typespec-python] accept is not defined in generated build request method #2670

@swathipil

Description

@swathipil

I re-generated code from [this spec] with the most recent typespec-python version (0.24.3) and it's no longer outputting the accept = kwargs.get('Accept', ...) line when building these two requests:

https://github.com/Azure/azure-sdk-for-python/blob/44b7842a848b2413c4c8743760c7d4c5e48f355b/sdk/schemaregistry/azure-schemaregistry/azure/schemaregistry/_operations/_operations.py#L90

https://github.com/Azure/azure-sdk-for-python/blob/44b7842a848b2413c4c8743760c7d4c5e48f355b/sdk/schemaregistry/azure-schemaregistry/azure/schemaregistry/_operations/_operations.py#L116

This results in the following error:

File "C:\Users\swathip\venvs\env311\Lib\site-packages\azure\schemaregistry\_operations\_operations.py", line 107, in build_schema_registry_get_schema_by_id_request
    _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")    
                                                      ^^^^^^
NameError: name 'accept' is not defined

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions