Skip to content

[codex] Share fake data context - #32

Merged
k-kinzal merged 2 commits into
mainfrom
codex/share-fake-data-context
Jul 4, 2026
Merged

[codex] Share fake data context#32
k-kinzal merged 2 commits into
mainfrom
codex/share-fake-data-context

Conversation

@k-kinzal

@k-kinzal k-kinzal commented Jul 4, 2026

Copy link
Copy Markdown
Owner

What changed

  • Added FakeDataContext to hold one schema, one OperationLookup, one configured OpenAPIFaker, and the resolved faker options.
  • Updated Interceptor to create a single fake-data context and reuse it for operation lookup and generated responses.
  • Updated FakeRequest and FakeResponse to accept FakeDataContext as a source and to route lookup/faker calls through the context.
  • Documented FakeDataContext as a reusable source for standalone generation.

Why

Operation lookup and OpenAPI faker creation were repeated across Interceptor, FakeRequest, and FakeResponse. This scattered the generation setup and forced hot request paths to rebuild faker state for every generated response.

Impact

Existing Server and Schema sources continue to work. Callers that generate multiple requests/responses from the same schema can now create one FakeDataContext and reuse it.

Validation

  • composer test
  • composer lint

@k-kinzal
k-kinzal marked this pull request as ready for review July 4, 2026 13:39
@k-kinzal
k-kinzal merged commit 6490f16 into main Jul 4, 2026
57 checks passed
@k-kinzal
k-kinzal deleted the codex/share-fake-data-context branch July 4, 2026 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant