Skip to content

Conversation

blindaa121
Copy link
Collaborator

@blindaa121 blindaa121 commented Jun 11, 2025

Description

This PR consists of added support for allowing users to add a x-position vendor extension for positioning sidebar items accordingly. The x-position: number can be defined at the endpoint/method level and can be used for the following scenarios:

  1. Multiple methods with a defined x-position will be positioned in ascending order, followed by any other sidebar items in their original order.
  2. Single method with a defined x-position will take precedence followed by other sidebar items in their original order.

Motivation and Context.

See #1147 for context.

How Has This Been Tested?

Tested by defining a x-position for the following Petstore methods:

  1.  put:
       tags:
         - pet
       summary: Update an existing pet
       description: ""
       operationId: updatePet
       responses:
         "400":
           description: Invalid ID supplied
         "404":
           description: Pet not found
         "405":
           description: Validation exception
       security:
         - petstore_auth:
             - "write:pets"
             - "read:pets"
       x-position: 1
    
  2.  post:
       tags:
         - pet
       summary: Updates a pet in the store with form data
       description: ""
       operationId: updatePetWithForm
       parameters:
         - name: petId
           in: path
           description: ID of pet that needs to be updated
           required: true
           schema:
             type: integer
             format: int64
       responses:
         "405":
           description: Invalid input
       security:
         - petstore_auth:
             - "write:pets"
             - "read:pets"
       x-position: 2
    

Screenshots (if appropriate)

Original sidebar item positions

image

Added x-position vendor extension

Screenshot 2025-06-10 at 5 17 27 PM

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist

  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes if appropriate.
  • All new and existing tests passed.

Copy link

Size Change: 0 B

Total Size: 2.14 MB

ℹ️ View Unchanged
Filename Size
demo/.docusaurus/codeTranslations.json 2 B
demo/.docusaurus/docusaurus.config.mjs 14.3 kB
demo/.docusaurus/globalData.json 55.1 kB
demo/.docusaurus/i18n.json 267 B
demo/.docusaurus/registry.js 80 kB
demo/.docusaurus/routes.js 75.7 kB
demo/.docusaurus/routesChunkNames.json 31.3 kB
demo/.docusaurus/site-metadata.json 1.35 kB
demo/build/assets/css/styles.********.css 146 kB
demo/build/assets/js/main.********.js 709 kB
demo/build/assets/js/runtime~main.********.js 20.1 kB
demo/build/index.html 91.5 kB
demo/build/petstore/add-pet/index.html 28.1 kB
demo/build/petstore/create-user/index.html 22.2 kB
demo/build/petstore/create-users-with-array-input/index.html 22.3 kB
demo/build/petstore/create-users-with-list-input/index.html 22.3 kB
demo/build/petstore/delete-order/index.html 22.3 kB
demo/build/petstore/delete-pet/index.html 22.3 kB
demo/build/petstore/delete-user/index.html 22.6 kB
demo/build/petstore/find-pets-by-status/index.html 23 kB
demo/build/petstore/find-pets-by-tags/index.html 23.7 kB
demo/build/petstore/get-inventory/index.html 21.6 kB
demo/build/petstore/get-order-by-id/index.html 22.5 kB
demo/build/petstore/get-pet-by-id/index.html 23.1 kB
demo/build/petstore/get-user-by-name/index.html 22.6 kB
demo/build/petstore/login-user/index.html 23.2 kB
demo/build/petstore/logout-user/index.html 21.9 kB
demo/build/petstore/new-pet/index.html 22.5 kB
demo/build/petstore/pet/index.html 20.8 kB
demo/build/petstore/place-order/index.html 21.8 kB
demo/build/petstore/schemas/apiresponse/index.html 23.6 kB
demo/build/petstore/schemas/cat/index.html 37.5 kB
demo/build/petstore/schemas/category/index.html 24.7 kB
demo/build/petstore/schemas/dog/index.html 37.9 kB
demo/build/petstore/schemas/honeybee/index.html 37.9 kB
demo/build/petstore/schemas/id/index.html 21.7 kB
demo/build/petstore/schemas/order/index.html 25.8 kB
demo/build/petstore/schemas/pet/index.html 37.4 kB
demo/build/petstore/schemas/tag/index.html 23.1 kB
demo/build/petstore/schemas/user/index.html 45.6 kB
demo/build/petstore/store/index.html 20 kB
demo/build/petstore/subscribe-to-the-store-events/index.html 28.6 kB
demo/build/petstore/swagger-petstore-yaml/index.html 28.7 kB
demo/build/petstore/update-pet-with-form/index.html 22.5 kB
demo/build/petstore/update-pet/index.html 22.9 kB
demo/build/petstore/update-user/index.html 22.5 kB
demo/build/petstore/upload-file/index.html 22.3 kB
demo/build/petstore/user/index.html 20.5 kB

compressed-size-action

@blindaa121 blindaa121 self-assigned this Jun 11, 2025
@blindaa121 blindaa121 added the enhancement New feature or request label Jun 11, 2025
Copy link

Visit the preview URL for this PR (updated for commit 91aaf76):

https://docusaurus-openapi-36b86--pr1160-xip0c1ca.web.app

(expires Fri, 11 Jul 2025 00:54:57 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: bf293780ee827f578864d92193b8c2866acd459f

@blindaa121 blindaa121 merged commit 5fb1191 into main Jun 11, 2025
11 checks passed
dsuket added a commit to dsuket/docusaurus-openapi-docs that referenced this pull request Oct 13, 2025
fix: change label

change tab label name of anyOf/oneOf

build

feat: refactor request and response example

fix: primitive

add build

fix: Added handling for when there is no schema.

feat: Add new endpoints for allOf with nested array items and properties in OpenAPI schema

[Enhancement] Add vendor extension support for positioning sidebar items (PaloAltoNetworks#1160)

* Add support for x-position vendor extension and sorting logic

* Add position and x-position types

chore: restrict workflows to main repo (PaloAltoNetworks#1169)

docs: fix typos and tables (PaloAltoNetworks#1170)

Change the tab label of anyOf/oneOf (PaloAltoNetworks#1167)

* feat: support null type

* fix: fix tab label

refactor: refactor request and response example (PaloAltoNetworks#1161)

* feat: refactor request and response example

* fix: primitive

refactor: change ResponseSamples to CodeSamples (PaloAltoNetworks#1162)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant