You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[~] Have you provided a full/minimal spec to reproduce the issue?
Have you validated the input using an OpenAPI validator, yes I used the validate function of the api generator
[5.0.0 ] What's the version of OpenAPI Generator used?
Have you search for related issues/PRs?
What's the actual output vs expected output?
Description
The automated code generation feature for example code in the HTML2 generator does not produce valid code for the authetification settings.
With the following security scheme the generator creates a code example like this
# Configure API key authorization: myAuthHeaderopenapi_client.configuration.api_key['myAuthHeader'] ='YOUR_API_KEY'# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed# openapi_client.configuration.api_key_prefix['myAuthHeader'] = 'Bearer'# Create an instance of the API classapi_instance=openapi_client.MyApi()
This can not be executed, with the following error.
Bug Report Checklist
Description
The automated code generation feature for example code in the HTML2 generator does not produce valid code for the authetification settings.
With the following security scheme the generator creates a code example like this
This can not be executed, with the following error.
The following code snippet can be executed, this issue probably exists for more than just header based authentifications.
This example is based upon the example within the python class definition for the Configuration class
openapi-generator version
OpenAPI declaration file content or url
Generation Details
using java -jar openapi generate html2 -i MyApi.yaml -o html2_doc
using java -jar openapi generate python -i MyApi.yaml -o python_client
Steps to reproduce
Related issues/PRs
Suggest a fix
Use sample Code generation which is used by the python client generator itself.
See getting started section of that generators readme.md
The text was updated successfully, but these errors were encountered: