knuckleswtf / knuckleswtf/scribe
How to generate submenus for gitbook using docs.openapi
- Dominant language
- PHP
- Stars
- 2.3k
- Forks
- 357
- PR merge metrics
- No merged PRs in 30d
Description
### Scribe version
5.0
### PHP version
8.3
### Laravel version
11
### Scribe config
```ruby
------ SAME AS DEFAULT CONFIG ------
```
### What happened?
I have this set up, and the docs generates fine, but I would prefer for all of them to come under a submenu on Gitbook:
```php
class ProductController extends Controller
{
/**
* Get product categories.
*
* This endpoint retrieves product categories.
*
* @header Authorization cHVibGlja2V5OnByaXZhdGVrZXk=
* @header X-Shipment-Mode SFN
*
* @urlParam id integer optional The ID of the specific category to retrieve. Example: 1
*
* @response 200
* {
* "success": true,
* "status_code": 200,
* "message": "Product categories retrieved successfully",
* "data": [
* {
* "id": 1,
* "name": "Electronics",
* "description": "Electronic devices and accessories",
* "active": true
* }
* ]
* }
*
* @response 500
* {
* "success": false,
* "status_code": 500,
* "message": "Failed to retrieve product categories",
* "data": []
* }
*
* @group Product
* @subgroup Get product categories
*/
public function getProductCategories(null|int $id = null): JsonResponse
/**
* Get products.
*
* This endpoint retrieves products.
*
* @header Authorization cHVibGlja2V5OnByaXZhdGVrZXk=
* @header X-Shipment-Mode SFN
*
* @urlParam id integer optional The ID of the specific product to retrieve. Example: 1
*
* @response 200
* {
* "success": true,
* "status_code": 200,
* "message": "Products retrieved successfully",
* "data": [
* {
* "id": 1,
* "name": "Smartphone",
* "description": "Latest smartphone model",
* "price": 599.99,
* "active": true
* }
* ]
* }
*
* @response 500
* {
* "success": false,
* "status_code": 500,
* "message": "Failed to retrieve products",
* "data": []
* }
*
* @group Product
* @subgroup Get product
*/
public function getProducts(ProductReadRequest $request, null|string|int $id = null): JsonResponse
/**
* Search products.
*
* This endpoint searches for products and retrieves matches.
*
* @header Authorization cHVibGlja2V5OnByaXZhdGVrZXk=
* @header X-Shipment-Mode SFN
*
* @urlParam value string required The search term for products. Example: smartphone
*
* @response 200
* {
* "success": true,
* "status_code": 200,
* "message": "Product search completed successfully",
* "data": [
* {
* "id": 1,
* "name": "Smartphone",
* "description": "Latest smartphone model",
* "price": 599.99,
* "active": true
* }
* ]
* }
*
* @response 500
* {
* "success": false,
* "status_code": 500,
* "message": "Failed to search products",
* "data": []
* }
*
* @group Product
* @subgroup Search products
*/
public function searchProducts(string $value): JsonResponse
/**
* Verify product.
*
* This endpoint verifies a product using its HS code.
*
* @header Authorization cHVibGlja2V5OnByaXZhdGVrZXk=
* @header X-Shipment-Mode SFN
*
* @bodyParam hs_code string required The HS code of the product to verify. Example: 0101210000
*
* @response 200
* {
* "success": true,
* "status_code": 200,
* "message": "Product verified successfully",
* "data": {
* "hs_code": "0101210000",
* "valid": true,
* "description": "Live animals; horses, asses, mules and hinnies",
* "category": "Animals"
* }
* }
*
* @response 404
* {
* "success": false,
* "status_code": 404,
* "message": "Product not found",
* "data": []
* }
*
* @response 500
* {
* "success": false,
* "status_code": 500,
* "message": "Failed to verify product",
* "data": []
* }
*
* @group Product
* @subgroup Verify products
*/
public function verifyProduct(ProductVerifyRequest $request): JsonResponse
```
### Docs
- [x] I've checked [the docs](https://scribe.knuckles.wtf/laravel), the [troubleshooting guide](https://scribe.knuckles.wtf/laravel/troubleshooting), and [existing issues](https://github.com/knuckleswtf/scribe/issues?q=is%3Aissue+), but I didn't find a solution
Contributor guide
Research direction
The report names ProductController and Scribe's Laravel documentation/OpenAPI output, but no repository file or test. Start with the linked Laravel documentation and the generated GitBook/OpenAPI structure, then trace how the Product group and subgroups are emitted. Done means the Product endpoints appear under a Product submenu in GitBook.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- laravel, openapi, php
- Domain
- api, documentation
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100