Open Closed

toJson is not a function #10360


0
learner29 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.


9 Answer(s)
  • 0
    ismcagdas created
    Support Team

    Hi @learner29

    We got your email and reply in a short time.

    Thanks,

  • 0
    musa.demir created
    Support Team

    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.

  • 0
    learner29 created

    Hi, Is there any update?

  • 0
    musa.demir created
    Support Team

    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?

  • 0
    learner29 created

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

  • 0
    learner29 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

  • 0
    learner29 created

    Hi,

    Is there any update?

    Thanks

  • 0
    musa.demir created
    Support Team

    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?

  • 0
    learner29 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