mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-11-18 06:38:21 +01:00
Update REST Admin interface to support "Get Mapping(s) as C# Code" (#878)
* Add /__admin/mappings/code endpoint * api * fix * . * fix * . * . * .
This commit is contained in:
1 parent
0fc664b404
commit
7fe2c8af78
45 files changed
+900
-448
No files matched your search
@@ -7,6 +7,7 @@ using WireMock.Admin.Mappings;
|
||||
using WireMock.Admin.Requests;
|
||||
using WireMock.Admin.Scenarios;
|
||||
using WireMock.Admin.Settings;
|
||||
using WireMock.Types;
|
||||
|
||||
namespace WireMock.Client
|
||||
{
|
||||
@@ -52,6 +53,13 @@ namespace WireMock.Client
|
||||
[Get("mappings")]
|
||||
Task<IList<MappingModel>> GetMappingsAsync();
|
||||
|
||||
/// <summary>
|
||||
/// Get the C# code from all mappings
|
||||
/// </summary>
|
||||
/// <returns>C# code</returns>
|
||||
[Get("mappings/code")]
|
||||
Task<string> GetMappingsCodeAsync([Query] MappingConverterType mappingConverterType = MappingConverterType.Server);
|
||||
|
||||
/// <summary>
|
||||
/// Add a new mapping.
|
||||
/// </summary>
|
||||
@@ -97,6 +105,15 @@ namespace WireMock.Client
|
||||
[Get("mappings/{guid}")]
|
||||
Task<MappingModel> GetMappingAsync([Path] Guid guid);
|
||||
|
||||
/// <summary>
|
||||
/// Get the C# code from a mapping based on the guid
|
||||
/// </summary>
|
||||
/// <param name="guid">The Guid</param>
|
||||
/// <param name="mappingConverterType">The optional mappingConverterType (can be Server or Builder)</param>
|
||||
/// <returns>C# code</returns>
|
||||
[Get("mappings/code/{guid}")]
|
||||
Task<string> GetMappingCodeAsync([Path] Guid guid, [Query] MappingConverterType mappingConverterType = MappingConverterType.Server);
|
||||
|
||||
/// <summary>
|
||||
/// Update a mapping based on the guid
|
||||
/// </summary>
|
||||
|
||||
Reference in new issue
Block a user