Fix missing imports for schemaMapping in API interfaces - #24672
Fix missing imports for schemaMapping in API interfaces#24672SubhamAshok wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 21 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
513b0cd to
0f63419
Compare
There was a problem hiding this comment.
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
|
cc @OpenAPITools/generator-core-team as the change covers default codegen |
719e231 to
6c265cd
Compare
|
@SubhamAshok you handle the missing imports for the response. I guess we need both |
| File output = Files.createTempDirectory("test").toFile(); | ||
| output.deleteOnExit(); | ||
|
|
||
| final CodegenConfigurator configurator = new CodegenConfigurator() |
There was a problem hiding this comment.
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"));
|
Thanks @jpfinne! I've updated the PR to handle both parameters and responses, and refactored the test using \generateFromContract. Let me know if everything looks good now. |
Fixes #24232
PR checklist
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.