Azure / autorest.java

Extension for AutoRest (https://github.com/Azure/autorest) that generates Java code
MIT License
33 stars 80 forks source link

[bug] tsp, failed to load example when run in SDK repo #2635

Closed weidongxu-microsoft closed 4 months ago

weidongxu-microsoft commented 4 months ago
warning: typespec-java - Examples directory 'examples/2023-10-01' does not exist. @ unknown

Potential cause is the relative path and working directory, when using tsp-client (the working directory seems to be cwd, but the typespec project be under TempTypeSpecFiles/DevCenter).

had to use

    examples-directory: "TempTypeSpecFiles/DevCenter/examples"

to make it work in SDK repo.


Another problem is that the operation object is not same, if client.tsp customize via providing a new interface. https://github.com/Azure/azure-rest-api-specs/blob/main/specification/devcenter/DevCenter/client.tsp

interface DevCenterClientOperations {
  listProjects is DevCenterService.DevCenter.listProjects;
  getProject is DevCenterService.DevCenter.getProject;
}

The listProjects to the left and the listProjects to the right are 2 different operation instances.

One hack could be to try operation.sourceOperation for example map, if not found on operation itself.

weidongxu-microsoft commented 4 months ago