[PR #706] [MERGED] Provide open api schema to dynamic examples generator so you can generate accurate data #1043

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

📋 Pull Request Information

Original PR: https://github.com/wiremock/WireMock.Net/pull/706
Author: @brunotarghetta
Created: 12/23/2021
Status: Merged
Merged: 12/28/2021
Merged by: @StefH

Base: masterHead: GenerateDynamicExampleUsingOpenApiSchema


📝 Commits (4)

  • 4abe702 Provide open api schema to dynamic examples generator so you can generate accurate data using settings like max-length in case of a string
  • 3cd94d8 Rename Schema Property and add a dynamic examples generator with properties from settings like max-length
  • 7356578 Remove blank lines
  • 957e3d8 Add virtual to all public method in WireMockOpenApiParserExampleValues and ireMockOpenApiParserDynamicExampleValues to extend and overrides examples values

📊 Changes

9 files changed (+188 additions, -52 deletions)

View changed files

examples/WireMock.Net.OpenApiParser.ConsoleApp/DynamicDataGeneration.cs (+26 -0)
examples/WireMock.Net.OpenApiParser.ConsoleApp/OpenApiFiles/Swagger_Customer_V2.0.json (+73 -0)
📝 examples/WireMock.Net.OpenApiParser.ConsoleApp/Program.cs (+45 -27)
📝 examples/WireMock.Net.OpenApiParser.ConsoleApp/Run.cs (+7 -5)
📝 examples/WireMock.Net.OpenApiParser.ConsoleApp/WireMock.Net.OpenApiParser.ConsoleApp.csproj (+3 -0)
📝 src/WireMock.Net.OpenApiParser/Settings/IWireMockOpenApiParserExampleValues.cs (+7 -1)
📝 src/WireMock.Net.OpenApiParser/Settings/WireMockOpenApiParserDynamicExampleValues.cs (+12 -9)
📝 src/WireMock.Net.OpenApiParser/Settings/WireMockOpenApiParserExampleValues.cs (+13 -10)
📝 src/WireMock.Net.OpenApiParser/Utils/ExampleValueGenerator.cs (+2 -0)

📄 Description

@StefH Having ope api Schema we can use settings like max-length in case of a string to generate more accurate mock data when you implement your dynamic examples


🔄 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/706 **Author:** [@brunotarghetta](https://github.com/brunotarghetta) **Created:** 12/23/2021 **Status:** ✅ Merged **Merged:** 12/28/2021 **Merged by:** [@StefH](https://github.com/StefH) **Base:** `master` ← **Head:** `GenerateDynamicExampleUsingOpenApiSchema` --- ### 📝 Commits (4) - [`4abe702`](https://github.com/wiremock/WireMock.Net/commit/4abe702c264ca14605eb22bf3fef6aa79a6496e8) Provide open api schema to dynamic examples generator so you can generate accurate data using settings like max-length in case of a string - [`3cd94d8`](https://github.com/wiremock/WireMock.Net/commit/3cd94d8289a7681a7b71839f8976c4348ce79fe0) Rename Schema Property and add a dynamic examples generator with properties from settings like max-length - [`7356578`](https://github.com/wiremock/WireMock.Net/commit/73565787a3e13297f6e50c9e03ab0d31e19a5ca5) Remove blank lines - [`957e3d8`](https://github.com/wiremock/WireMock.Net/commit/957e3d8df8a5203928283b944706da7e61eb39bb) Add virtual to all public method in WireMockOpenApiParserExampleValues and ireMockOpenApiParserDynamicExampleValues to extend and overrides examples values ### 📊 Changes **9 files changed** (+188 additions, -52 deletions) <details> <summary>View changed files</summary> ➕ `examples/WireMock.Net.OpenApiParser.ConsoleApp/DynamicDataGeneration.cs` (+26 -0) ➕ `examples/WireMock.Net.OpenApiParser.ConsoleApp/OpenApiFiles/Swagger_Customer_V2.0.json` (+73 -0) 📝 `examples/WireMock.Net.OpenApiParser.ConsoleApp/Program.cs` (+45 -27) 📝 `examples/WireMock.Net.OpenApiParser.ConsoleApp/Run.cs` (+7 -5) 📝 `examples/WireMock.Net.OpenApiParser.ConsoleApp/WireMock.Net.OpenApiParser.ConsoleApp.csproj` (+3 -0) 📝 `src/WireMock.Net.OpenApiParser/Settings/IWireMockOpenApiParserExampleValues.cs` (+7 -1) 📝 `src/WireMock.Net.OpenApiParser/Settings/WireMockOpenApiParserDynamicExampleValues.cs` (+12 -9) 📝 `src/WireMock.Net.OpenApiParser/Settings/WireMockOpenApiParserExampleValues.cs` (+13 -10) 📝 `src/WireMock.Net.OpenApiParser/Utils/ExampleValueGenerator.cs` (+2 -0) </details> ### 📄 Description @StefH Having ope api Schema we can use settings like max-length in case of a string to generate more accurate mock data when you implement your dynamic examples --- <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:34:28 +01:00
adam closed this issue 2025-12-29 08:34:28 +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#1043