Skip to content

Fix missing imports for schemaMapping in API interfaces - #24672

Open
SubhamAshok wants to merge 2 commits into
OpenAPITools:masterfrom
SubhamAshok:fix/24232-schemaMapping-missing-import
Open

Fix missing imports for schemaMapping in API interfaces#24672
SubhamAshok wants to merge 2 commits into
OpenAPITools:masterfrom
SubhamAshok:fix/24232-schemaMapping-missing-import

Conversation

@SubhamAshok

@SubhamAshok SubhamAshok commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Fixes #24232

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.
  • Run the following to build the project and update samples:
    ./mvnw clean package
    ./bin/generate-samples.sh
    ./bin/utils/export_docs_generators.sh
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    For Windows users, please run the script in Git BASH.
  • File the PR against the correct branch: \master\ (6.3.0) (minor release - breaking changes with fallbacks), \7.0.x\ (breaking changes without fallbacks)
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request. @jpfinne @wing328

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 21 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

@SubhamAshok
SubhamAshok force-pushed the fix/24232-schemaMapping-missing-import branch from 513b0cd to 0f63419 Compare August 10, 2026 20:11

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 1 file (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

@SubhamAshok

Copy link
Copy Markdown
Contributor Author

cc @wing328 @jpfinne - I saw PR #24261 was stalled. I tried a different approach here that seems to pass CI without triggering those extra imports. Let me know what you think.

@wing328

wing328 commented Aug 14, 2026

Copy link
Copy Markdown
Member

cc @OpenAPITools/generator-core-team as the change covers default codegen

@SubhamAshok
SubhamAshok force-pushed the fix/24232-schemaMapping-missing-import branch from 719e231 to 6c265cd Compare August 19, 2026 04:02

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

Copy link
Copy Markdown
Contributor

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

Re-trigger cubic

@jpfinne

jpfinne commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

@SubhamAshok you handle the missing imports for the response.
My PR #24261 add the imports for the parameters.

I guess we need both

File output = Files.createTempDirectory("test").toFile();
output.deleteOnExit();

final CodegenConfigurator configurator = new CodegenConfigurator()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I find the generatedContract method simpler to review:

Map<String, File> files = generateFromContract(
                "src/test/resources/3_0/spring/issue_24232.yaml", SPRING_BOOT,
                Map.of(USE_SPRING_BOOT4, true),
                codegenConfigurator ->
                        codegenConfigurator
                                .addTypeMapping("string+custom", "MyCustomId")
                                .addSchemaMapping("MyKey", "MyCustomKey")
                                .addImportMapping("MyCustomId", "org.myorg.MyCustomId")
                                .addImportMapping("MyCustomKey", "org.myorg.MyCustomKey"));

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] [JAVA] [SPRING] missing import for schemaMapping in api

3 participants