Skip to content

mgmt, bug fix on extra Resource class generated, prepare release 0.32.1#3182

Merged
weidongxu-microsoft merged 18 commits intoAzure:mainfrom
weidongxu-microsoft:mgmt_bug-fix
Aug 15, 2025
Merged

mgmt, bug fix on extra Resource class generated, prepare release 0.32.1#3182
weidongxu-microsoft merged 18 commits intoAzure:mainfrom
weidongxu-microsoft:mgmt_bug-fix

Conversation

@weidongxu-microsoft
Copy link
Member

@weidongxu-microsoft weidongxu-microsoft commented Aug 13, 2025

fix #3181
e.g. ResourceAutoGenerated, typically due to m4 de-duplicate, and duplicate "Resource" schema from common-types with that defined in Swagger, or 2 different version of it in common-types (storage is latter)

This could be fixed by correct the naming of the schema (e.g. from ResourceAutoGenerated to Resource, when this situation is detected). And this is the current solution.
core PR microsoft/typespec#8176

This PR contains the e2e test as verification.

@weidongxu-microsoft weidongxu-microsoft changed the title mgmt, bug fix on extra Resource class generated, like ResourceAutoGenerated mgmt, bug fix on extra Resource class generated Aug 13, 2025
github-merge-queue bot pushed a commit to microsoft/typespec that referenced this pull request Aug 13, 2025
@weidongxu-microsoft weidongxu-microsoft changed the title mgmt, bug fix on extra Resource class generated mgmt, bug fix on extra Resource class generated, prepare release 0.32.1 Aug 14, 2025
@weidongxu-microsoft
Copy link
Member Author

weidongxu-microsoft commented Aug 14, 2025

  1. rename causes problem, need to fix http-client-java, bug fix on parent resource rename microsoft/typespec#8190
  2. not sure why we see this in communication libs (but other customization libs pass)
error @azure-tools/typespec-java/generator-error: com.microsoft.typespec.http.client.generator.TypeSpecPlugin - Cannot read customization from base directory /mnt/vss/_work/1/s/azure-sdk-for-java/sdk/communication/azure-communication-jobrouter/TempTypeSpecFiles/Communication.JobRouter/azure-sdk-for-java/sdk/communication and file /mnt/vss/_work/1/s/azure-sdk-for-java/sdk/communication/azure-communication-jobrouter/TempTypeSpecFiles/Communication.JobRouter/azure-sdk-for-java/sdk/communication/azure-communication-jobrouter/customization/src/main/java/JobRouterSdkCustomization.java
error @azure-tools/typespec-java/generator-error: com.microsoft.typespec.http.client.generator.TypeSpecPlugin - Unable to complete customization
java.lang.NullPointerException: Cannot invoke "java.lang.Class.getConstructor(java.lang.Class[])" because "customizationClass" is null
	at com.microsoft.typespec.http.client.generator.core.postprocessor.Postprocessor.postProcess(Postprocessor.java:100)
	at com.microsoft.typespec.http.client.generator.Main.handleDPG(Main.java:162)
	at com.microsoft.typespec.http.client.generator.Main.main(Main.java:89)

error @azure-tools/typespec-java/generator-error: com.microsoft.typespec.http.client.generator.TypeSpecPlugin - Failed to complete postprocessing.
java.lang.RuntimeException: Unable to complete customization
	at com.microsoft.typespec.http.client.generator.core.postprocessor.Postprocessor.postProcess(Postprocessor.java:105)
	at com.microsoft.typespec.http.client.generator.Main.handleDPG(Main.java:162)
	at com.microsoft.typespec.http.client.generator.Main.main(Main.java:89)
Caused by: java.lang.NullPointerException: Cannot invoke "java.lang.Class.getConstructor(java.lang.Class[])" because "customizationClass" is null
	at com.microsoft.typespec.http.client.generator.core.postprocessor.Postprocessor.postProcess(Postprocessor.java:100)
	... 2 more

error @azure-tools/typespec-java/generator-error: com.microsoft.typespec.http.client.generator.Main - Unhandled error.
java.lang.RuntimeException: Failed to complete postprocessing.
	at com.microsoft.typespec.http.client.generator.core.postprocessor.Postprocessor.postProcess(Postprocessor.java:112)
	at com.microsoft.typespec.http.client.generator.Main.handleDPG(Main.java:162)
	at com.microsoft.typespec.http.client.generator.Main.main(Main.java:89)
Caused by: java.lang.RuntimeException: Unable to complete customization
	at com.microsoft.typespec.http.client.generator.core.postprocessor.Postprocessor.postProcess(Postprocessor.java:105)
	... 2 more
Caused by: java.lang.NullPointerException: Cannot invoke "java.lang.Class.getConstructor(java.lang.Class[])" because "customizationClass" is null
	at com.microsoft.typespec.http.client.generator.core.postprocessor.Postprocessor.postProcess(Postprocessor.java:100)
	... 2 more

error @azure-tools/typespec-java/unknown-error: An unknown error occurred. Error occurred while running Java generator. The emitter was unable to generate client code from this TypeSpec, please open an issue on https://github.com/microsoft/typespec, include TypeSpec source and all the diagnostic information in your submission. Error: java ended with code '1'.
    at ChildProcess.<anonymous> (file:///mnt/vss/_work/1/s/azure-sdk-for-java/sdk/communication/azure-communication-jobrouter/TempTypeSpecFiles/node_modules/@azure-tools/typespec-java/dist/src/utils.js:82:29)
    at ChildProcess.emit (node:events:524:28)
    at ChildProcess._handle.onexit (node:internal/child_process:293:12)
Error: Error: java ended with code '1'.
Failed to generate client

Problem caused by tspconfig and latest tsp-client Azure/azure-rest-api-specs#36663

@weidongxu-microsoft weidongxu-microsoft marked this pull request as ready for review August 15, 2025 05:00
@weidongxu-microsoft weidongxu-microsoft merged commit fab9647 into Azure:main Aug 15, 2025
5 checks passed
@weidongxu-microsoft weidongxu-microsoft deleted the mgmt_bug-fix branch August 15, 2025 05:41
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.

[mgmt] Unused ResourceAutoGenerated.java get generated

2 participants