Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] [Python] UNKNOWNBASETYPE appear in api py #12404

Closed
2 of 6 tasks
DoneSpeak opened this issue May 20, 2022 · 2 comments
Closed
2 of 6 tasks

[BUG] [Python] UNKNOWNBASETYPE appear in api py #12404

DoneSpeak opened this issue May 20, 2022 · 2 comments

Comments

@DoneSpeak
Copy link

DoneSpeak commented May 20, 2022

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
openapi-generator version

master

OpenAPI declaration file content or url

swagger.json

Generation Details
> python3 --version
Python 3.8.10

> java --version                                                                                            
openjdk 11.0.14 2022-01-18 LTS
OpenJDK Runtime Environment Zulu11.54+23-CA (build 11.0.14+9-LTS)
OpenJDK 64-Bit Server VM Zulu11.54+23-CA (build 11.0.14+9-LTS, mixed mode)
git clone https://github.com/openapitools/openapi-generator
cd openapi-generator
mvn clean package
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar  generate \
    -i api-def/swagger.json \
    -g python \
    --artifact-id symbility_api \
    --package-name symbility_api \
    -o api/
Steps to reproduce

see ap/symbility_api/api/claim_api.py

The unknown_base_type, UNKNOWNBASETYPE, unknownbasetype and UNKNOWN_BASE_TYPE donesn't exist.

from symbility_api.model.unknownbasetype import UNKNOWNBASETYPE
.....
        self.claim_set_claim_status_endpoint = _Endpoint(
            settings={
                'response_type': (ClaimStatus,),
                'auth': [
                    'OAuth2'
                ],
                'endpoint_path': '/v03_08/claims/{claimID}/claim-status',
                'operation_id': 'claim_set_claim_status',
                'http_method': 'PUT',
                'servers': None,
            },
            params_map={
                'all': [
                    'claim_id',
                    'from_user_id_specification',
                    'unknown_base_type',
                ],
                'required': [
                    'claim_id',
                ],
                'nullable': [
                    'unknown_base_type',
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'claim_id':
                        (str,),
                    'from_user_id_specification':
                        (str,),
                    'unknown_base_type':
                        (UNKNOWN_BASE_TYPE,),
                },
                'attribute_map': {
                    'claim_id': 'claimID',
                    'from_user_id_specification': 'From-User-ID-Specification',
                },
                'location_map': {
                    'claim_id': 'path',
                    'from_user_id_specification': 'header',
                    'unknown_base_type': 'body',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/json'
                ],
                'content_type': [
                    'application/json'
                ]
            },
            api_client=api_client
        )

after remove the unknowtype, I got:

image

image

Related issues/PRs
Suggest a fix
@wing328
Copy link
Member

wing328 commented May 20, 2022

Thanks for reporting the issue. Can you try the branch inline-parameter-enhance in #12369, which provides better support for inline schemas?

@wing328
Copy link
Member

wing328 commented Jun 8, 2022

The fix has been merged into master and included in the v6.0.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants