OpenAPITools / OpenAPITools/openapi-generator

[BUG] - [JAVA] - UNKNOWN_BASE_TYPE is not auto-generated from open-api spec yaml

Open
#20,680 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Bug Report Checklist
  • [x ] Have you provided a full/minimal spec to reproduce the issue?
  • [x ] Have you validated the input using an OpenAPI validator (example)?
  • [x ] Have you tested with the latest master to confirm the issue still exists?
  • [x ] Have you searched for related issues/PRs?
  • [x ] What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

While using version 5.4.0, for the schema attribute which is defined without type , it's generated as InlineObject, InlineObject1 is created,
We are upgrading to 6.0.0 version , where the inline object is not generated and recognized as Unknown_Base_Type.java
Could you please help us to config this.

Image

Actual Code:

Image

Expected Code:

Image

openapi-generator version

6.6.0

OpenAPI declaration file content or url
      requestBody:
        description: Contract info parameters
        content:
          application/json:
            schema:
              type: object
              properties:
                requestInfo:
                  $ref: '#/components/schemas/BadPayerInfo' 
                referenceNumber:
                  type: string

Generation Details

Pom.xml used to generate code
Image

Steps to reproduce

For the above yaml file mentioned, use the pom. xml to generate java code, InLineObject is not generated.

Suggest a fix

Please help us to fix this issue to replace the autogeneration of inLineObject.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the supplied OpenAPI YAML and pom.xml generation configuration, then reproduce the Java output using OpenAPI Generator 6.6.0. Compare the generated Unknown_Base_Type.java result with the expected inline object behavior; done means the inline schema is generated and referenced correctly instead of producing Unknown_Base_Type.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, openapi
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.