Can we create a subfolder like structure? to display it on readme.io #4892
-
How to Create Hierarchical Folder Structure in OpenAPI Documentation?🤔 QuestionI'm working with a large OpenAPI specification (40+ endpoints) and trying to organize my documentation with a hierarchical folder structure in ReadMe. I want to achieve something like this in the sidebar:
Is this possible with ReadMe's current OpenAPI implementation? 🔍 What I've Already TriedAttempt 1: Hierarchical Tag Namestags:
- name: "User Management > Users"
- name: "User Management > Users > Authentication"
- name: "User Management > Roles & Permissions"
- name: "E-commerce > Products"
- name: "E-commerce > Products > Categories"
- name: "E-commerce > Orders" Result: Creates flat tags with Attempt 2: Tag Groups (x-tagGroups)x-tagGroups:
- name: User Management
tags:
- Users
- User Authentication
- Roles & Permissions
- Profile Management
- name: E-commerce
tags:
- Products
- Product Categories
- Orders
- Shopping Cart Result: Groups tags but still flat structure within groups Attempt 3: Path-based OrganizationTried organizing file references in nested folders: paths:
/users/auth/login:
$ref: ./paths/UserManagement/Users/Authentication/post-login.yaml
/products/categories:
$ref: ./paths/Ecommerce/Products/Categories/get-categories.yaml Result: Works for file organization but doesn't affect ReadMe sidebar structure 💭 Current Environment
❓ My Questions
🎯 Why I Need This
💡 Potential Solutions (If Feature Doesn't Exist)If this isn't currently supported, I'd love to see: Option 1: Enhanced Tag Systemtags:
- name: "User Authentication"
x-readme-parent: "Users"
x-readme-folder: true Option 2: Folder Extensionx-readme-folders:
- name: "User Management"
children:
- name: "Users"
children:
- name: "Authentication" Option 3: Auto-inference from PathsAutomatically create folders based on URL structure:
Can anyone help me figure out if this is possible, or should I submit this as a feature request? Looking forward to your insights! 🙏 |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
We could potentially nest under ...
paths:
/x:
./y:
get: ...
./z:
get: ... which would be equivalent to, in 3.x: ...
paths:
/x/y:
get: ...
/x/z:
get: ... which correspond to these APIs:
This would be pretty straightforward to represent in the schema. Just add this to the path-item definition: $defs:
...
path-item:
properties:
existing definitions... (parameters, additionalOperations, legacy method names)
patternProperties:
'^\./':
$ref: '$defs/path-item-or-ref' (edited: okay that's not quite right, as we only want this under |
Beta Was this translation helpful? Give feedback.
-
You just did! :) |
Beta Was this translation helpful? Give feedback.
-
OpenAPI 3.2 will add a |
Beta Was this translation helpful? Give feedback.
OpenAPI 3.2 will add a
parent
field to the Tag Object which essentially is Option 1 of your potential solutions.