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
[Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
I am generating a Python client. I want to import some classes instead of generating them. The documentation says to use importMappings or schemaMappings. They don't work.
The importMappings are ignored. I found the code that clears them:
// clear import mapping (from default generator) as python does not use it// at the momentimportMapping.clear();
The schemaMappings can be used to map the schema to something else (e.g. external objects/models outside of the package) according to the customization page. It is unclear how to set them when generating Python clients. They do not add import statements at the top of the generated file. Instead, they camelCase the values. I have used the schemaMappings successfully when generating Java clients for my API, but for Python client codegen they don't work.
I appreciate any advice. Thanks.
openapi-generator version
7.2.0
OpenAPI declaration file content or url
openapi: 3.0.3info:
version: 2.7.0title: Person APItags:
- name: Persondescription: Part of the Person API.x-tag-expanded: falsepaths:
/person:
get:
tags:
- Personsummary: Get a PersonoperationId: getPersonresponses:
'200':
description: A person object.content:
application/json:
schema:
$ref: '#/components/schemas/Person'components:
schemas:
# The Address should be imported, not generatedAddress:
type: objectproperties:
full_address:
type: stringPerson:
type: objectproperties:
id:
type: stringfirst_name:
type: stringlast_name:
type: stringage:
type: integeraddress:
$ref: '#/components/schemas/Address'
Bug Report Checklist
Description
I am generating a Python client. I want to import some classes instead of generating them. The documentation says to use
importMappings
orschemaMappings
. They don't work.The
importMappings
are ignored. I found the code that clears them:The
schemaMappings
can be used to map the schema to something else (e.g. external objects/models outside of the package) according to the customization page. It is unclear how to set them when generating Python clients. They do not add import statements at the top of the generated file. Instead, they camelCase the values. I have used theschemaMappings
successfully when generating Java clients for my API, but for Python client codegen they don't work.I appreciate any advice. Thanks.
openapi-generator version
7.2.0
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
Use the gradle plugin with these settings:
The result is the following code:
Related issues/PRs
Suggest a fix
The text was updated successfully, but these errors were encountered: