Page 2 of 2

Re: c# example res/json web API ?

Posted: Mon Mar 15, 2021 4:19 pm
by Oliver Heilig
Hello Stefan,

this seems to be a problem of the latest autorest version, we will check this. But you can also use my sample for xServer 2.19. The generated code contains methods for all services, for example

xServer.CalculateRoute
xServer.SearchLocations

Oli

Re: c# example res/json web API ?

Posted: Mon Mar 15, 2021 4:35 pm
by stefan.rotaru
Hello Oliver,

Thank you for the response.
Can you please give me the link where I can find the generated code for the services in xServer 2.19?

Thank you.

Re: c# example res/json web API ?

Posted: Mon Mar 15, 2021 4:48 pm
by Oliver Heilig
Hello Stefan,

you can find the generated code in the attachment at https://xserver.ptvgroup.com/forum/view ... =733#p3634

But i think i have found the problem: The latest version uses a new beta C#-generator which seems to cause this problem.

https://github.com/Azure/autorest.csharp

You can use the old (working) generator by adding a --legacy parameter. Honestly this whole Swagger/OpenAPI stuff is still in its infancy, but you should give it another try.

Oli

Re: c# example res/json web API ?

Posted: Mon Mar 15, 2021 5:49 pm
by stefan.rotaru
Works with --legacy parameter, thanks.

Re: c# example res/json web API ?

Posted: Fri Sep 23, 2022 4:02 pm
by Oliver Heilig
For your information:

Since the installation and usage of the autorest generator tool can be quite troublesome in some environments, we now also provide a download of the generated source code as part of the xServer C# client bundle.

Oli