OpenAPITools / OpenAPITools/openapi-generator

[BUG] [wsdl-schema] Generated reference does not match schema name

Open
#13,512 3 comments 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

Description

The schema name used as type (schema:object_abc) does not match the name of the complexType (ObjectAbc).

openapi-generator version

6.1.0

OpenAPI declaration file content or url

openapi.yaml:

openapi: "3.0.0"
info:
  title: My API
  version: 1.2.3

components:
  schemas:
    object_abc:
      type: object
      properties:
        sub1:
          $ref: '#/components/schemas/object_def'
      required:
      - sub1
    object_def:
      type: object
      properties:
        key:
          type: string
      required:
      - key

paths: {}
Generation Details

Command:

java -jar openapi-generator-cli-6.1.0.jar generate -g wsdl-schema -i "openapi.yaml" -o output

Generated WSDL schemas:

<xs:complexType name="ObjectAbc">
  <xs:sequence>
    <xs:element minOccurs="1" name="sub1" type="schemas:object_def" />
  </xs:sequence>
</xs:complexType>
<xs:complexType name="ObjectDef">
  <xs:sequence>
    <xs:element minOccurs="1" name="key" type="xs:string" />
  </xs:sequence>
</xs:complexType>

Expected:

<xs:complexType name="object_abc">
  <xs:sequence>
    <xs:element minOccurs="1" name="sub1" type="schemas:object_def" />
  </xs:sequence>
</xs:complexType>
<xs:complexType name="object_def">
  <xs:sequence>
    <xs:element minOccurs="1" name="key" type="xs:string" />
  </xs:sequence>
</xs:complexType>

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

Reproduce the issue with openapi.yaml and the Java openapi-generator-cli command, then trace the wsdl-schema generator's schema-name handling from the generated WSDL. Done means the complexType names remain object_abc and object_def while the referenced element type remains schemas:object_def, matching the expected output.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, openapi
Domain
api, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.