Base solution for your next web application
Open Closed

toJson is not a function #10360


User avatar
0
fawad29 created

Prerequisites

Please answer the following questions before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

  • What is your product version? - v 10
  • What is your product type (Angular or MVC)? - Angular
  • What is product framework type (.net framework or .net core)? -.net core

I am receiving toJson function. I have emailed the code regarding this issue, please have a look.


11 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @learner29

    We got your email and reply in a short time.

    Thanks,

  • User Avatar
    0
    musa.demir created

    Hi @learner29 Dto classes generated by nswag have the toJSON method. I checked your email and it seems like BatchRunInputDto does not have one. Since you forgot to share it with email, can you please check if it exists? And can you please remove your service-proxies.ts file and re-generate it by running the npm run nswag command.

    You can check the CreateXDTO that you share with us and see the example toJSON method.

  • User Avatar
    0
    fawad29 created

    Hi, Is there any update?

  • User Avatar
    0
    musa.demir created

    Hi @learner29 Can you please share BatchRunInputDto and other related parts of the codes via mail. I will try to implement it to clean project and reproduce it?

  • User Avatar
    0
    fawad29 created

    @musa.demir I have emailed the related code, now.

  • User Avatar
    0
    fawad29 created

    Hi @musa.demir, Is there any update?

    I deleted service-proxies.ts, and recreated it with the command you mentioned, however toJson function was not created. If you want you can do a remote session to find the reason why nswag is not creating toJson method. This has happened on some other classess as well but not all.

    Thanks

  • User Avatar
    0
    fawad29 created

    Hi,

    Is there any update?

    Thanks

  • User Avatar
    0
    musa.demir created

    Hi @learner29

    In the mail that you share Application and Application.Shared folders are identical.


    I could not reproduce your problem in clean project. BatchRunInputDto was generated successfully. Can you please check if you have more then one class named BatchRunInputDto in different namespaces?

  • User Avatar
    0
    fawad29 created

    Hi @musa.demir,

    I have checked and there is only class. Same class is not defined in different namespaces.

    I have sent a new email. Could you do a remote session as that would help check issues quickly?

    Thanks

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @learner29

    I have sent you another email about this problem.

  • User Avatar
    0
    ismcagdas created
    Support Team

    @learner29's answer via email:

    Thank you for your remote session the other day. Yes, I was able to resolve the issue.