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# code generator improvements #933

Merged

Conversation

cezarypiatek
Copy link
Contributor

This PR brings the following improvements:

  • Add quote escaping in generated C# strings
  • Handle JSON in the response body. Json is converted to C# anonymous object definition and fed into WithBodyAsJson method.

string FormatObject(JObject jObject)
{
var indStr = new string(' ', 4 * ind);
var indStrSub = new string(' ', 4 * (ind+1));
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you do a format document in visual studio?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@cezarypiatek cezarypiatek force-pushed the feature/code_generator_improvements branch from 647a473 to f95ac54 Compare May 7, 2023 12:13
@StefH StefH merged commit 7d9e450 into WireMock-Net:master May 7, 2023
@cezarypiatek
Copy link
Contributor Author

Thanks for merging. Btw, do you have a plan for the next release? I would like to start using the code generation feature but I need those recent changes.

@StefH
Copy link
Collaborator

StefH commented May 7, 2023

@cezarypiatek Today I'll release new NuGet.

@cezarypiatek
Copy link
Contributor Author

great, thank you!

@StefH StefH added the feature label May 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants