Repository navigation
fix: skip vendor extensions at the path level(#891) - #1440
Conversation
|
Thanks for the fix! Confirmed the crash and that this resolves it. A few suggestions before merging:
Happy to merge once those are addressed (or as-is if you'd rather ship the fix now and file a follow-up). |
|
Visit the preview URL for this PR (updated for commit 38131e1): (expires Mon, 11 May 2026 14:38:41 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: bf293780ee827f578864d92193b8c2866acd459f |
|
@sserrata , do you have a timeline or plan for the next release that includes this fix? |
* feat(plugin): support the HTTP QUERY method from OpenAPI 3.2 QUERY is standardised by RFC 10008 and OpenAPI 3.2 adds `query` as a fixed field of the Path Item Object. Since the path-level vendor extension fix (#1440), operations are filtered through an HTTP method list without `query`, so QUERY operations got no page at all. - generate pages for `query` operations (and their callbacks) - strip their `servers` before the Postman conversion, like other verbs - require openapi-to-postmanv2 ^6.4.0, the first version that builds a QUERY request (for `openapi: 3.2.x` specs), so code samples and the API explorer send QUERY Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(theme): colour the QUERY method badge QUERY had no badge colour (`badge--undefined`). Give it the GET colour: like GET, QUERY is a safe and idempotent read (RFC 10008), and the six Infima badge colours are all taken. Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(demo): add a QUERY example and its sidebar styles - add a `query` operation (Search Cakes) to the OpenAPI 3.2 bakery example - add the `query` sidebar method label to the demo styles, the palette themes (GET colours) and the styling docs snippets Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(plugin): only create QUERY pages for OpenAPI 3.2 and later `query` is a Path Item field only from OpenAPI 3.2, the first version openapi-to-postmanv2 builds a QUERY request for. A `query` key in an older spec gave a page with no request, so the explorer sent GET with a body and the code samples showed GET. Skip it, like any other unknown path item key. Co-Authored-By: Claude Opus 5.5 <[email protected]> * refactor(plugin): share one HTTP method list The Postman `servers` cleanup, the page filter, the callback tabs and `isOperationName` each had their own copy of the HTTP methods, and `isOperationName` still missed `trace` and `query`. They now all read `HTTP_METHODS`, kept in alphabetical order so the callback tab order does not change. Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(template): add the QUERY sidebar label to the project template New sites from create-docusaurus-openapi-docs now label QUERY operations in the sidebar, with the GET colour like the method badge. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Thomas Meghe <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Steven Serrata <[email protected]>
Description
The plugin fails when the OpenAPI spec file contains vendor extensions at the path level (e.g. x-* fields directly under a path object). This results in a runtime error during the build process.
Motivation and Context
OpenAPI allows vendor extensions (x-*) at almost any level of the specification, including the path level. However, the current implementation assumes all path-level properties conform to expected schema objects and attempts to process vendor extensions as structured objects.
This leads to a crash when a primitive value (e.g. string or boolean) is encountered, as the code tries to assign properties like description to it.
This change ensures that vendor extensions at the path level are safely ignored or handled correctly, preventing the build from failing.
Issue: #891
How Has This Been Tested?
I modified the petstore.yaml example to include vendor extensions at the path level:
Before the fix
Running:
Resulted in:
After the fix
Running:
Produces:
The build now completes successfully without errors.
Screenshots (if appropriate)
Types of changes
Checklist