Skip to content

fix #22571 (OpenAPINormalizer): Removed reset of OAS content#22573

Merged
wing328 merged 2 commits intoOpenAPITools:masterfrom
JPPortier:BUG-22571-fix
Feb 23, 2026
Merged

fix #22571 (OpenAPINormalizer): Removed reset of OAS content#22573
wing328 merged 2 commits intoOpenAPITools:masterfrom
JPPortier:BUG-22571-fix

Conversation

@JPPortier
Copy link
Copy Markdown
Contributor

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • GitHub's linking syntax (e.g., having "fixes #123" present in the PR description)

@JPPortier
Copy link
Copy Markdown
Contributor Author

For reference, related to:

Not having enough insight about the right path to fix how specification are lost during the normalization

@wing328 wing328 closed this Jan 6, 2026
@wing328 wing328 reopened this Jan 6, 2026
@wing328
Copy link
Copy Markdown
Member

wing328 commented Jan 13, 2026

    type: string
    format: null
    $ref: null
    description: null
    title: purple
    multipleOf: null
    maximum: null
    exclusiveMaximum: null
    minimum: null
    exclusiveMinimum: null
    maxLength: null
    minLength: null
    pattern: null
    maxItems: null
    minItems: null
    uniqueItems: null
    maxProperties: null
    minProperties: null
    required: null
    not: null
    properties: null
    additionalProperties: null
    nullable: null
    readOnly: null
    writeOnly: null
    example: null
    externalDocs: null
    deprecated: null
    discriminator: null
    xml: null
}]]
[INFO]
[INFO]
[ERROR] Tests run: 3612, Failures: 2, Errors: 0, Skipped: 4
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for openapi-generator-project 7.19.0-SNAPSHOT:
[INFO]
[INFO] openapi-generator-project .......................... SUCCESS [  3.079 s]
[INFO] openapi-generator-core ............................. SUCCESS [  6.827 s]
[INFO] openapi-generator (core library) ................... FAILURE [02:37 min]
[INFO] openapi-generator (executable) ..................... SKIPPED
[INFO] openapi-generator (maven-plugin) ................... SKIPPED
[INFO] openapi-generator-gradle-plugin (maven wrapper) .... SKIPPED
[INFO] openapi-generator-online ........................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  02:50 min
[INFO] Finished at: 2026-01-13T14:02:19+08:00
[INFO] ------------------------------------------------------------------------
[INFO] 27 goals, 27 executed
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.2.5:test (default-test) on project openapi-generator: There are test failures.
[ERROR]
[ERROR] Please refer to C:\Users\User\code\openapi-generator2\modules\openapi-generator\target\surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.

build failed

can you please take a look when you've time?

@JPPortier
Copy link
Copy Markdown
Contributor Author

can you please take a look when you've time?

Hi William thank your for feedback,

I could but purpose of this PR was to be able to have feedback about what could be the proper way to fix this: If just removing the "reset" if good enough no problem and I should be able to update tests.

Not sure to have myself enough knowledge of tool but another idea could have been to still transform list of const as enum because if will enable to have them used from mustache templates for any languages, but may be adding some "x-enum-deprecated" (like there is x-enum-descriptions: https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/java/org/openapitools/codegen/OpenAPINormalizer.java#L1487)

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

@JPPortier
Copy link
Copy Markdown
Contributor Author

Hi @wing328 ,

Tests updated.

So this PR is not enhancing anything regarding how to parse 3.1 and "const" values but Normalizer no longer remove information from schemas.

@wing328 wing328 added this to the 7.21.0 milestone Feb 16, 2026
@wing328
Copy link
Copy Markdown
Member

wing328 commented Feb 23, 2026

thanks for the PR

let's give it a try

@wing328 wing328 merged commit 905b930 into OpenAPITools:master Feb 23, 2026
15 checks passed
davidricodias pushed a commit to davidricodias/openapi-generator that referenced this pull request Mar 11, 2026
…ent (OpenAPITools#22573)

* fix (OpenAPINormalizer): Removed reset of OAS content

* feat (Normalizer): Reset from Normalizer with 3.0 only. Fix tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants