Skip to content

samples/batch/python/main.py README Instructions to create Python library "swagger_client" No Longer Works #2934

@ahotrod

Description

@ahotrod

Below are the current samples/batch/python/main.py README.md instructions to create "swagger_client":

How to use the Speech Services Batch Transcription API from Python
Download and install the API client library
To execute the sample you need to generate the Python library for the REST API which is generated through Swagger.

Follow these steps for the installation:

Go to https://editor.swagger.io/.
Click File, then click Import URL.
Enter the Swagger URL for the Speech Services API: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cognitiveservices/data-plane/Speech/SpeechToText/stable/2024-11-15/speechtotext.json.
Click Generate Client and select Python.
Save the client library.
Extract the downloaded python-client-generated.zip somewhere in your file system.
Install the extracted python-client module in your Python environment using pip: pip install path/to/package/python-client.
The installed package has the name swagger_client. You can check that the installation worked using the command python -c "import swagger_client".

Describe the bug

https://editor.swagger.io/ no longer generates "swagger_client" for Python using the Swagger URL for the Speech Services API. Quoting the website "Swagger Editor has evolved! Codegen, save, and export features are now part of Swagger Pro." However, Swagger Pro only supports "swagger_client" Version 3, not Version 2 which I understand is what batch/python/main.py is based on. Completely different structures V2 versus V3.

Using Visual Studio Code with WSL.

How to get a samples/batch/python/main.py-compatible "swagger_client"?

Metadata

Metadata

Assignees

No one assigned

    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