[BUG][Python] own Endpoint type shadows autogenerated Endpoint helper for python
Created by: RonnyPfannschmidt
Bug Report Checklist
-
Have you provided a full/minimal spec to reproduce the issue? -
Have you validated the input using an OpenAPI validator (example)? -
Have you tested with the latest master to confirm the issue still exists? -
Have you searched for related issues/PRs? -
What's the actual output vs expected output? -
[Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
having a openapi type declared endpoint creates the following wrong file header
from openapi_client.api_client import ApiClient, Endpoint
from openapi_client.model_utils import ( # noqa: F401
check_allowed_values,
check_validations,
date,
datetime,
file_type,
none_type,
validate_and_convert_types
)
from openapi_client.model.endpoint import Endpoint
the own model will then shadow the helper and break the api spec
openapi-generator version
5.0.0
OpenAPI declaration file content or url
{
"openapi": "3.0.3",
"paths": {
"/endpoints": {
"post": {
"operationId": "EndpointService_createEndpoint",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Endpoint"
}
}
}
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Endpoint"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"Endpoint": {
"required": [
"description",
"name",
"type"
],
"type": "object",
"properties": {
"description": {
"type": "string",
"nullable": false
},
"enabled": {
"type": "boolean"
},
"id": {
"type": "string",
"format": "uuid"
},
"name": {
"type": "string",
"nullable": false
},
"properties": {
}
}
}
}
},
"info": {
"description": "The API for Integrations",
"version": "1.0",
"title": "Integrations"
},
"servers": [
{
"url": "http://localhost:{port}",
"description": "Development Server",
"variables": {
"basePath": {
"default": "/api/integrations/v1.0"
},
"port": {
"default": "8080"
}
}
}
]
}
(for JSON code), so it becomes more readable. If it is longer than about ten lines, please create a Gist (https://gist.github.com) or upload it somewhere else and link it here. -->
Steps to reproduce
java -jar openapi-generator-cli.jar generate -i api.notifications.integrations.spec.json -g python
Suggest a fix
i strongly suggest to import the api_client
module and use api_client.Endpoint