Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/move-openapi-example-to-fixtures.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"counterfact": patch
---

Moved `openapi-example.yaml` from the repository root into `test/fixtures/openapi-example.yaml` and expanded it with many OpenAPI edge cases: CRUD operations on `/users` and `/users/{userId}`, polymorphic events via `oneOf`/`allOf`/`discriminator`, nullable fields, enum types, integer formats, file upload via `multipart/form-data`, cookie parameters, deprecated endpoints, multiple response content types, a no-body `204` health-check endpoint, and free-form `additionalProperties` objects.
128 changes: 0 additions & 128 deletions openapi-example.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"lint:quickfix": "eslint --fix . eslint --fix demo-ts --rule=\"import/namespace: 0,etc/no-deprecated:0,import/no-cycle:0,no-explicit-type-exports/no-explicit-type-exports:0,import/no-deprecated:0,import/no-self-import:0,import/default:0,import/no-named-as-default:0\" --ignore-pattern dist --ignore-pattern out",
"go:petstore": "yarn build && yarn counterfact https://petstore3.swagger.io/api/v3/openapi.json out",
"go:petstore2": "yarn build && yarn counterfact https://petstore.swagger.io/v2/swagger.json out",
"go:example": "yarn build && node ./bin/counterfact.js ./openapi-example.yaml out",
"go:example": "yarn build && node ./bin/counterfact.js ./test/fixtures/openapi-example.yaml out",
"counterfact": "./bin/counterfact.js",
"postinstall": "patch-package"
},
Expand Down
4 changes: 2 additions & 2 deletions test/app.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ describe("handleMswRequest", () => {
await (app as any).createMswHandlers(
{
...mockConfig,
openApiPath: "openapi-example.yaml",
openApiPath: "test/fixtures/openapi-example.yaml",
},
MockModuleLoader,
);
Expand Down Expand Up @@ -120,7 +120,7 @@ describe("createMswHandlers", () => {
const handlers = await (app as any).createMswHandlers(
{
...mockConfig,
openApiPath: "openapi-example.yaml",
openApiPath: "test/fixtures/openapi-example.yaml",
},
MockModuleLoader,
);
Expand Down
Loading
Loading