You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A neat feature would be to use the mock feature with a tool like fakerjs and essentially be able to mock a full API, and generate random data.
For instance when building a user management tool it would be nice to be able to generate 100's of random users mocking the graph endpoints to test things like pagination without having to create those users in my dev tenant
That's a great idea! Recently, we released a set of mocks for all Graph endpoints based on Graph API reference docs, but I can imagine that you might need some other/more content.
Did you give some thought how you'd see it work? Would you like the Proxy to generate the mocks on the fly (making the outcomes dynamic but less predictable) or would you rather have something like a subcommand that you can use to generate a specific set of mocks, like m365proxy mock user --numItems 100 and the command would generate hundred mocked users in a mock file that you can plug into the Proxy?
That's a good question - my use case was actually just needing random data, I don't necessarily have an opinion on the "best way" - I guess the main thing is just mapping the Graph responses to a "mock" dataset
Looked at this in the context of our current capabilities. We've come a long way since this was originally filed.
What exists now
MockGeneratorPlugin: Records live API responses into mock files. This gets you real data but requires actual API access.
LLM integration: We have ILanguageModelClient with OpenAI and Ollama backends plus a .prompty template system. This is the natural path for generating realistic fake data.
Rather than integrating a data generation library like Faker.js (wrong ecosystem — we're .NET), I think we should leverage our existing LLM infrastructure:
This ties directly into #531. When the --use-language-model flag is set:
Parse the OpenAPI spec to get paths, operations, and response schemas
For each operation, send the schema to the LLM with a prompt like: "Generate a realistic JSON response matching this schema for a {operationId} endpoint. Generate {count} items for array responses."
Use the response as the mock body
Save to mocks file
Count/volume support: A --count flag could control how many items to generate for collection endpoints (e.g., --count 100 for the /users scenario from the original request).
Pagination: For large collections, we could auto-generate paginated mock responses with proper @odata.nextLink or similar pagination markers, depending on the API style.
This approach gives the best of both worlds: realistic data without needing actual API access, and it works for any API with an OpenAPI spec.
Activity
waldekmastykarz commentedon Aug 8, 2023
That's a great idea! Recently, we released a set of mocks for all Graph endpoints based on Graph API reference docs, but I can imagine that you might need some other/more content.
Did you give some thought how you'd see it work? Would you like the Proxy to generate the mocks on the fly (making the outcomes dynamic but less predictable) or would you rather have something like a subcommand that you can use to generate a specific set of mocks, like
m365proxy mock user --numItems 100and the command would generate hundred mocked users in a mock file that you can plug into the Proxy?Tanddant commentedon Aug 8, 2023
That's a good question - my use case was actually just needing random data, I don't necessarily have an opinion on the "best way" - I guess the main thing is just mapping the Graph responses to a "mock" dataset
waldekmastykarz commentedon Feb 26, 2026
Looked at this in the context of our current capabilities. We've come a long way since this was originally filed.
What exists now
ILanguageModelClientwith OpenAI and Ollama backends plus a.promptytemplate system. This is the natural path for generating realistic fake data.Proposed approach
Rather than integrating a data generation library like Faker.js (wrong ecosystem — we're .NET), I think we should leverage our existing LLM infrastructure:
CLI command:
devproxy mock generate --openapi <spec> --use-language-modelThis ties directly into #531. When the
--use-language-modelflag is set:Count/volume support: A
--countflag could control how many items to generate for collection endpoints (e.g.,--count 100for the/usersscenario from the original request).Pagination: For large collections, we could auto-generate paginated mock responses with proper
@odata.nextLinkor similar pagination markers, depending on the API style.This approach gives the best of both worlds: realistic data without needing actual API access, and it works for any API with an OpenAPI spec.
waldekmastykarz commentedon Oct 31, 2026
Closing: language models now cover realistic data generation (see #531 / #2036), so a dedicated fake-data generator isn't needed.