Skip to content

Move openapi-example.yaml to test/fixtures and flesh out with edge cases#1829

Merged
pmcelhaney merged 3 commits intomainfrom
copilot/move-openapi-example-to-fixtures
Apr 11, 2026
Merged

Move openapi-example.yaml to test/fixtures and flesh out with edge cases#1829
pmcelhaney merged 3 commits intomainfrom
copilot/move-openapi-example-to-fixtures

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 11, 2026

Summary

Moves openapi-example.yaml from the repository root into test/fixtures/openapi-example.yaml and expands it with a comprehensive set of OpenAPI edge cases to better exercise the code generator and server.

Changes

  • test/fixtures/openapi-example.yaml – new home for the file, greatly expanded:
    • Full CRUD resource: GET /users, POST /users, GET/PUT/PATCH/DELETE /users/{userId}
    • Polymorphic event ingestion at POST /events using oneOf + allOf + discriminator
    • Nullable fields, enums, integer formats (int64, double) on GET /products/{productId}
    • File upload via multipart/form-data at POST /uploads
    • Cookie parameter + deprecated endpoint at GET /legacy/items
    • Multiple response content types (application/json, text/csv, application/pdf) at GET /reports/{reportId}
    • 204-only health-check at GET /ping
    • Free-form additionalProperties object at PUT /metadata
    • anyOf on product attributes
    • Multiple reusable $ref response components (BadRequest, Unauthorized, NotFound, InternalServerError)
    • Three security schemes (basicAuth, bearerAuth, apiKey) with global security + per-endpoint overrides
    • Pagination query parameters with minimum/maximum/default constraints
    • Response headers (x-total-count, x-next-page, x-rate-limit-remaining)
  • package.jsongo:example script updated to new path
  • test/app.test.ts – two openApiPath references updated
  • test/typescript-generator/generate.test.tsgenerate() call updated
  • test/typescript-generator/__snapshots__/generate.test.ts.snap – regenerated
  • .changeset/move-openapi-example-to-fixtures.md – changeset entry added

Manual acceptance tests

  • yarn go:example starts the server successfully against the new fixture path with no errors
  • GET /users returns a 200 with the withUsers example payload
  • POST /events with a ClickEvent body returns 202 Accepted
  • GET /products/42 returns a 200 with a Product-shaped response
  • GET /ping returns 204 with no body
  • Existing routes unrelated to the moved file (e.g. petstore) behave unchanged

@pmcelhaney pmcelhaney marked this pull request as ready for review April 11, 2026 15:02
@pmcelhaney pmcelhaney enabled auto-merge April 11, 2026 15:02
@pmcelhaney pmcelhaney added this pull request to the merge queue Apr 11, 2026
Merged via the queue into main with commit f7ee9e2 Apr 11, 2026
8 of 9 checks passed
@pmcelhaney pmcelhaney deleted the copilot/move-openapi-example-to-fixtures branch April 11, 2026 15:12
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.

2 participants