Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C# Dot Net Core Codegen #57

Open
wants to merge 35 commits into
base: develop
Choose a base branch
from

Conversation

Clamibot
Copy link

My partner and I created a C# code snippet generator to generate .Net Core Web API code for web requests. We used the C# RestSharp code snippet generator as our basis.

Clamibot and others added 30 commits July 11, 2019 15:44
This update adds in the folder for the C# .Net Core code snipped generator. Contents from csharp-restsharp were copied into this folder and will be modified to generate C# code snippets utilizing .Net Core.
I ported a few RestSharp functions to .Net Core compatible code. The .Net Core code snippet generator now includes the functions for:
- Adding request headers
- Adding timeouts
- Sending the request
I renamed restcharp.js to dotnetcore.js and fixed a little whoops I found.
I reformatted some of the code so eslintrc no longer screams at me for formatting it doesn't like.
I fixed some formatting issues with strings.
I made some changes to the test cases so they would test for .Net Core compatible code instead of RestSharp API compatible code. I also made some formatting changes so the code looks nicer. In addition, I did more work porting over RestSharp code to .Net Core compatible code.
I ported RestSharp redirects to .Net Core Compatible code.
I formatted the generated code so it looks nice, and I finally found the code block where the other 23 tests are executed. All tests are now enabled.
I changed the compiler used when running tests becasue the VS compiler supports the syntax from newer versions of C#. I also added the required dependency for compilation and got rid of the one for RestSharp. In addition, file data is now inserted into the request body if a file is being sent with the request.
I fixed a few whoopsies in the code and added all required dependencies for main.cs to compile. There is a runtime error that needs to be fixed though.
Isaac and I implemented PATCH requests, and also added HEAD and OPTIONS requests to the list of requests like GET. In addition, I updated the sample test response to reflect the changes we made in the code snippet generator.
Also messed with var compile and var run, but they still throw errors
I redid the run and compile path variables since mono now works on our testbed machines.
I changed the dependencies to the libraries Mono provides so it can compile the source C# file generated by the code snippet generator.
I cleaned up the code and updated the boilerplate template.
Formatting for everything is currently unfinished
I did some formatting work on the request bodies so stuff wouldn't break when the code snippet generator generates a snippet.
Updated formatting for form data.
File uploads now partially work. We still need to implement a mechanism that inserts form data into the request.
File uploads now fully work. We're still working on uploading form data.
I optimized generated code snippets so the snippet itself would take less operations to compete its task. In addition, I cleaned up the code that generates the code snippets. In addition, I removed the tabs from the generated code since only the program skeleton will not be generated by the code snippet generator, just the body.
I implemented form data uploads.
I implemented uploading additional form data along with a file. In addition, I modified the sample test response json to match the current format of the snippet.
Clamibot and others added 2 commits July 25, 2019 09:15
I modified the sample test to accomodate for the new changes in the format of the generated code. In addition, I disabled most of the tests after they all passed.
codegens/csharp-dotnetcore/test/unit/convert.test.js Outdated Show resolved Hide resolved
codegens/csharp-dotnetcore/test/unit/convert.test.js Outdated Show resolved Hide resolved
codegens/csharp-dotnetcore/package.json Show resolved Hide resolved
.eslintrc Outdated Show resolved Hide resolved
My partner and I cleaned up all commented out code, we reverted changes to .eslintrc, we changed all the windows style linebreaks to unix style linebreaks, and we reformatted our code to make it compliant with the original rules defined in .eslintrc.
We reverted tha author name in package.json back to Postman Labs and added our names to dotnetcore.js instead.
Copy link

@allenheltondev allenheltondev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Glad to have native .NET core code!

@Misiu
Copy link

Misiu commented Feb 13, 2020

Any updates on this?
There is already C# - RestSharp, will this one be presented as a new language option?

@lechu445
Copy link

lechu445 commented Dec 6, 2020

@Clamibot there is a conflict, could you take a look at it?

@jamasul
Copy link

jamasul commented Aug 24, 2021

Status on this?

@Misiu
Copy link

Misiu commented Aug 25, 2021

@Clamibot ping?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants