[PR #933] [MERGED] C# code generator improvements #1154

Closed
opened 2025-12-29 08:35:00 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/wiremock/WireMock.Net/pull/933
Author: @cezarypiatek
Created: 5/7/2023
Status: Merged
Merged: 5/7/2023
Merged by: @StefH

Base: masterHead: feature/code_generator_improvements


📝 Commits (2)

  • 42e87b5 Escape quotes in generated C# strings
  • f95ac54 Handle response with JSON body in C# code generator

📊 Changes

3 files changed (+95 additions, -4 deletions)

View changed files

📝 src/WireMock.Net/Serialization/MappingConverter.cs (+63 -3)
📝 test/WireMock.Net.Tests/WireMockAdminApiTests.IWireMockAdminApi_GetMappingsCode.verified.txt (+29 -0)
📝 test/WireMock.Net.Tests/WireMockAdminApiTests.cs (+3 -1)

📄 Description

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.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/wiremock/WireMock.Net/pull/933 **Author:** [@cezarypiatek](https://github.com/cezarypiatek) **Created:** 5/7/2023 **Status:** ✅ Merged **Merged:** 5/7/2023 **Merged by:** [@StefH](https://github.com/StefH) **Base:** `master` ← **Head:** `feature/code_generator_improvements` --- ### 📝 Commits (2) - [`42e87b5`](https://github.com/wiremock/WireMock.Net/commit/42e87b5e9de3e437b514b91ea2bcb342f0564bce) Escape quotes in generated C# strings - [`f95ac54`](https://github.com/wiremock/WireMock.Net/commit/f95ac54506e0f83a069b29d7897e86d6e43c3394) Handle response with JSON body in C# code generator ### 📊 Changes **3 files changed** (+95 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `src/WireMock.Net/Serialization/MappingConverter.cs` (+63 -3) 📝 `test/WireMock.Net.Tests/WireMockAdminApiTests.IWireMockAdminApi_GetMappingsCode.verified.txt` (+29 -0) 📝 `test/WireMock.Net.Tests/WireMockAdminApiTests.cs` (+3 -1) </details> ### 📄 Description 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 08:35:00 +01:00
adam closed this issue 2025-12-29 08:35:00 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/WireMock.Net#1154