Bug report [Page generation Swagger CRUD page]

Please find the following scenario of a CRUD page generation with Swagger which is faulty. Having the proper GET, PATCH and DELETE methods, CRUD pages are generated but the project fails to compile. In particular, the proper pages are generated but compilation fails with the following error:

dotnet: C:\development\vs 2017\DeleteMeRad\server\Pages\EditCategoryDto.razor.designer.cs(85,108): error CS0103: The name 'body' does not exist in the current context [C:\development\vs 2017\DeleteMeRad\server\Test1.csproj]

The problem is at the form submission of the edit page:

Changing this to the appropriate parameter seems to solve the problem; it now compiles but have not checked yet how it behaves

Could you fix this or provide some insight as to how to avoid it?

Hi @goatofrafin,

Please send us your application to info@radzen.com to debug it. If the application is too big for attachment you can use sharing service like Google Drive.

Hi @goatofrafin ,

I've inspected your swagger and I've found that this is how the parameter is named - body:

In the other swagger however that you've sent us there is no such parameter at all:

Please disregard the swagger json file I 've sent separately; the fact remains that with the swagger IN the solution project, compilation fails. It is not a problem with sending wrong parameters to the REST API, it simply fails to compile which in turn means that something is wrong in the code generation part, am I right?

I see. It seems that this is not supported case with the CRUD pages generation wizard - it will expect this parameter to be named after type name.

So, what would be the right json content for Radzen to make the proper code generation?

You can name the parameter CategoryDto instead body.

After more inspection, the problem is that, instead of the Form0Submit method to pass args as the body of the method, it expects an EXTERNAL parameter called body. So this has NOTHING to do with the name or the type of the parameter. Could you please fix this?

I’m not sure if I understand this. Have you tried my suggestion?