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. It is supported for macOS, Windows, Linux, Android & iOS. A lightweight alternative to postman/insomnia.
https://apidash.dev
Apache License 2.0
1.59k stars 301 forks source link

Codegen c (libcurl) #332

Closed mohnishdeshpande closed 6 months ago

mohnishdeshpande commented 6 months ago

PR Description

Add codegen for C (libcurl).

Related Issues

Checklist

Added/updated tests?

We encourage you to add relevant test cases.

ashitaprasad commented 6 months ago

The generated code is not working for any of the cases where URL Params are present. Read and follow the instructions provided here properly - https://github.com/foss42/apidash/discussions/80

mohnishdeshpande commented 6 months ago

@ashitaprasad Is the code failing to compile or execute? The code was tested with various inputs, including with URL params. Could you please share the input that is causing this behaviour.

ashitaprasad commented 6 months ago

@mohnishdeshpande Run the codes generated for all the tests in your local computer. Now, create requests in API Dash for these models and send request and gather response. Now match the two outputs. In the comment below, mention your findings for all request models mentioned in the tests, i.e, GET 1-12, HEAD 1-2, POST 1-9, PUT 1, PATCH 1 & DELETE 1-2

animator commented 6 months ago

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

mohnishdeshpande commented 6 months ago

@ashitaprasad @animator Apologies, I missed that somehow. Anyway, I fixed it. Please have a look at the attached video recording of the working functionality. Screencast from 25-03-24 14:53:37.webm P.S. make sure to add '-lcurl' flag when compiling the code.

animator commented 6 months ago

The generated codes have errors and they have not been manually run and verified. Take a look at other codegen tests. Closing this PR.