Support Schema Example and Support AllOf in definitions (#669)

* Support an Example within a Schema

* Support AllOf in definitions

* Refactor MapSchemaAllOfToObject method and add test files

* Include schema examples

* Refactor duplicate code, create method MapPropertyAsJObject

* Remove commented code

* Merge from master + update WireMock.Net.OpenApiParser.ConsoleApp

Co-authored-by: Daniel <raiga1234@gmail.com>
This commit is contained in:
Stef Heyenrath
2021-10-27 09:40:12 +02:00
committed by GitHub
parent 25666152bb
commit a0e661fae9
8 changed files with 2419 additions and 36 deletions

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using WireMock.Admin.Mappings;
@@ -13,14 +13,12 @@ namespace WireMock.Net.OpenApiParser.ConsoleApp
{
public static class Run
{
public static void RunServer(string path)
public static WireMockServer RunServer(string path, string url)
{
string url1 = "http://localhost:9091/";
var server = WireMockServer.Start(new WireMockServerSettings
{
AllowCSharpCodeMatcher = true,
Urls = new[] { url1 },
Urls = new[] { url },
StartAdminInterface = true,
ReadStaticMappings = false,
WatchStaticMappings = false,
@@ -38,9 +36,7 @@ namespace WireMock.Net.OpenApiParser.ConsoleApp
server.WithMappingFromOpenApiFile(path, settings, out var diag);
Console.WriteLine("Press any key to stop the server");
System.Console.ReadKey();
server.Stop();
return server;
}
public static void RunServer(IEnumerable<MappingModel> mappings)