Skip to content

support multipart bodies for HTTP QUERY, add tests & docs (RFC 10008 / OAS 3.2) - #11052

Open
mdrezuanislamridoy wants to merge 1 commit into
swagger-api:mainfrom
mdrezuanislamridoy:Ridoy-Babu
Open

mdrezuanislamridoy wants to merge 1 commit into
swagger-api:mainfrom
mdrezuanislamridoy:Ridoy-Babu

Conversation

@mdrezuanislamridoy

Copy link
Copy Markdown

Summary

Adds end-to-end support and test coverage for the HTTP QUERY method (RFC 10008 / OpenAPI 3.2.0).

Most of the QUERY pipeline was already supported. This PR fixes the remaining curl generation issue and verifies the full flow with unit and E2E tests.

Changes

  • Fix: Added QUERY to the multipart/form-data curl generation path so requests correctly use -F flags instead of -d.
  • Unit tests:
    • Added curl generation tests for QUERY with:
      • No body
      • JSON body and headers
      • URI query strings
      • Multipart/form-data
      • No POST-specific bodyless behavior
    • Added selector coverage to ensure query: operations are parsed as method: "query".
    • Added GET/POST regression checks.
  • E2E tests:
    • Added a real local Node HTTP server that echoes the received HTTP method.
    • Added an OpenAPI 3.2.0 fixture with a query operation.
    • Added Cypress coverage confirming:
      • QUERY renders correctly in the UI.
      • The browser actually sends QUERY to the server.
      • Generated curl uses -X QUERY, not GET or POST.
  • Documentation:
    • Added docs/usage/http-query-method.md covering RFC 10008, OpenAPI usage, curl, CORS/preflight, and browser considerations.
    • Updated relevant configuration and CORS documentation.

Testing

  • npm run test:unit - 875 passed, 0 failed
  • ESLint - clean
  • npm run build:core - successful
  • Cypress - all 3 new QUERY E2E specs pass in Chrome 152 headless against the real local HTTP server

Limitations

  • QUERY is only supported natively through OpenAPI 3.2.0. No vendor-extension fallback is provided for older OpenAPI versions.
  • The full Cypress cy:ci suite was not run locally; only the new targeted QUERY spec was run. The full suite should be run in CI before merge.

Checklist

  • Bug fix
  • Improvement
  • Non-breaking change
  • Documentation updated
  • Tests added
  • Edge cases covered
  • All new and existing unit tests pass

@masfiktalukdar

Copy link
Copy Markdown

Great feature. It should be must implemented

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