OpenAPITools / OpenAPITools/openapi-generator

[BUG] [regression] [7.23.0] [InlineModelResolver] Previously generated sources are no longer generated without fallback

Open
#24,177 17 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

Bug Report Checklist
  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator?
  • 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?
Description

The release of 7.23.0 changed the output of generated files regarding the output of 7.22.0: files which was generated are no longer: by having a deduplication of duplicated schema, it cause a breaking change regarding existing generated sources availability.

The new behavior is good when a specification do not evolved in the time, i.e.: the schema won't have new fields added in the future.
But an SDK generated from specs with specs evolving can no longer have be used out of the box with 7.23.0

The inline model resolver make the assumption all use cases are requiring the deduplication.

As a "generic" tool, it should not assume about all the possible use cases.

In our use case: we are having, by purpose, schema defined multiple times within specs and they must not be deduplicated

openapi-generator version

7.23.0 regression VS previous 7.22.0

Related issues/PRs

This is introduced by this PR: https://github.com/OpenAPITools/openapi-generator/pull/23856
@Shaun-3adesign For reference

Suggest a fix

Provide a setting for model resolver enabling to activate/deactivate this automation for deduplication

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 InlineModelResolver and compare the model-generation behavior between OpenAPI Generator 7.22.0 and 7.23.0, using the reporter's specification if available. Read PR 23856 for the deduplication change; done means a setting can enable or disable this resolver behavior and previously generated sources remain available when disabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.