Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add possibility to use settings to generate MappingModel models with …
…wildcard path parameters. (#609) * Add optional settings for WithMappingFromOpenApi * . * . * cleanup
- Loading branch information
Showing
11 changed files
with
502 additions
and
297 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,57 @@ | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using Microsoft.OpenApi.Models; | ||
using Microsoft.OpenApi.Readers; | ||
using WireMock.Admin.Mappings; | ||
|
||
namespace WireMock.Net.OpenApiParser | ||
{ | ||
/// <summary> | ||
/// Parse a OpenApi/Swagger/V2/V3 or Raml to WireMock MappingModels. | ||
/// </summary> | ||
public interface IWireMockOpenApiParser | ||
{ | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using Microsoft.OpenApi.Models; | ||
using Microsoft.OpenApi.Readers; | ||
using WireMock.Admin.Mappings; | ||
using WireMock.Net.OpenApiParser.Settings; | ||
|
||
namespace WireMock.Net.OpenApiParser | ||
{ | ||
/// <summary> | ||
/// Parse a OpenApi/Swagger/V2/V3 or Raml to WireMock MappingModels. | ||
/// </summary> | ||
public interface IWireMockOpenApiParser | ||
{ | ||
/// <summary> | ||
/// Generate <see cref="IEnumerable{MappingModel}"/> from a file-path. | ||
/// </summary> | ||
/// <param name="path">The path to read the OpenApi/Swagger/V2/V3 or Raml file.</param> | ||
/// <param name="diagnostic">OpenApiDiagnostic output</param> | ||
/// <returns>MappingModel</returns> | ||
IEnumerable<MappingModel> FromFile(string path, out OpenApiDiagnostic diagnostic); | ||
|
||
/// <summary> | ||
/// Generate <see cref="IEnumerable{MappingModel}"/> from a file-path. | ||
/// </summary> | ||
/// <param name="path">The path to read the OpenApi/Swagger/V2/V3 or Raml file.</param> | ||
/// <param name="settings">Additional settings</param> | ||
/// <param name="diagnostic">OpenApiDiagnostic output</param> | ||
/// <returns>MappingModel</returns> | ||
IEnumerable<MappingModel> FromFile(string path, WireMockOpenApiParserSettings settings, out OpenApiDiagnostic diagnostic); | ||
|
||
/// <summary> | ||
/// Generate <see cref="IEnumerable{MappingModel}"/> from an <seealso cref="OpenApiDocument"/>. | ||
/// </summary> | ||
/// <param name="document">The source OpenApiDocument</param> | ||
/// <returns>MappingModel</returns> | ||
IEnumerable<MappingModel> FromDocument(OpenApiDocument document); | ||
|
||
/// <param name="settings">Additional settings [optional]</param> | ||
/// <returns>MappingModel</returns> | ||
IEnumerable<MappingModel> FromDocument(OpenApiDocument document, WireMockOpenApiParserSettings settings = null); | ||
|
||
/// <summary> | ||
/// Generate <see cref="IEnumerable{MappingModel}"/> from a <seealso cref="Stream"/>. | ||
/// </summary> | ||
/// <param name="stream">The source stream</param> | ||
/// <param name="diagnostic">OpenApiDiagnostic output</param> | ||
/// <returns>MappingModel</returns> | ||
IEnumerable<MappingModel> FromStream(Stream stream, out OpenApiDiagnostic diagnostic); | ||
|
||
/// <returns>MappingModel</returns> | ||
IEnumerable<MappingModel> FromStream(Stream stream, out OpenApiDiagnostic diagnostic); | ||
|
||
/// <summary> | ||
/// Generate <see cref="IEnumerable{MappingModel}"/> from a file-path. | ||
/// Generate <see cref="IEnumerable{MappingModel}"/> from a <seealso cref="Stream"/>. | ||
/// </summary> | ||
/// <param name="path">The path to read the OpenApi/Swagger/V2/V3 or Raml file.</param> | ||
/// <param name="stream">The source stream</param> | ||
/// <param name="settings">Additional settings</param> | ||
/// <param name="diagnostic">OpenApiDiagnostic output</param> | ||
/// <returns>MappingModel</returns> | ||
IEnumerable<MappingModel> FromFile(string path, out OpenApiDiagnostic diagnostic); | ||
} | ||
/// <returns>MappingModel</returns> | ||
IEnumerable<MappingModel> FromStream(Stream stream, WireMockOpenApiParserSettings settings, out OpenApiDiagnostic diagnostic); | ||
} | ||
} |
Oops, something went wrong.