foss42 / apidash

API Dash is a beautiful open-source cross-platform API Client built using Flutter which can help you easily create & customize your API requests, visually inspect responses and generate API integration code. A lightweight alternative to postman/insomnia.
https://apidash.dev
Apache License 2.0
1.43k stars 269 forks source link

Added CodeGen for C# (RestSharp) #351

Closed Tilakraj-B closed 5 months ago

Tilakraj-B commented 5 months ago

PR Description

added CodeGen for C# using RestSharp

Related Issues

Checklist

Added/updated tests?

animator commented 5 months ago

Provide all setup & testing instructions to run the generated code on machine locally.

Tilakraj-B commented 5 months ago

for setting up c# env in vs code : https://code.visualstudio.com/docs/csharp/get-started

after setting up go to the directory which contains Program.cs and install RestSharp using dotnet add package RestSharp

for testing you can paste the code generated in Program.cs and debug it using F5

Tilakraj-B commented 5 months ago

I overlooked the getValidRequestUri() function, both the functions can be removed.

animator commented 5 months ago

You did not run all the codes locally and test it .. Why is code generated in POST 1 failing to compile?

Tilakraj-B commented 5 months ago

I thought the link in the request model were dummy but now I tested all the requests and solved the error in the post request and updated the tests.

animator commented 5 months ago

Thanks for the PR.