Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find ClassName in apiGeneratorClass #16

Open
BardoBravo opened this issue Nov 9, 2019 · 2 comments
Open

Cannot find ClassName in apiGeneratorClass #16

BardoBravo opened this issue Nov 9, 2019 · 2 comments

Comments

@BardoBravo
Copy link

BardoBravo commented Nov 9, 2019

Hi,
When following the instructions for the Auto-generated REST API (link here), during the command conv-rest-api generate api -c car -f ./org1.car.config.json I get the error: "TypeError: Cannot read property 'getClassorThrow' of undefined". This is raised by reflectionUtils.js [152:41].

I am using a newer version of convector, where the file /org1.car.cconfig.json is now named as car.config.json, so I used that file.

I could notice that in class apiGenerator, the controllerName object was not retrieving the right data to variables plainName and controllersPattern. So I did a test and directly changed the file:

case 0:
  plainName = controllerName.replace('Controller', '').toLowerCase();
  controllersPattern = path_1.join(process.cwd(), ".") +
    ("/packages/**-cc/src/" + "car" + ".controller.ts");
    return [4, reflectionUtils_1.ReflectionUtils.getClassMethods(controllersPattern, 
       "CarController")];//controllerName)];

I have basically inserted the CarController name, and then it worked.

Do you have any idea on why the correct name for the class is not being used in the application?

@krafugo
Copy link

krafugo commented Jan 9, 2020

Hi @BardoBravo I have the same problem did you find any solution?

@BardoBravo
Copy link
Author

Hi @krafugo ,

In fact, I described the solution above, but did not received any feedback on why the original application is wrong, or if my solution is really the best one.

in the end, i recommend you to reach the official Discord channel - there they are way more active than here at GitHub.

[]s

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

No branches or pull requests

2 participants