Skip to content

How to generate submenus for gitbook using docs.openapi #1037

@africanies

Description

@africanies

Scribe version

5.0

PHP version

8.3

Laravel version

11

Scribe config

------ 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:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions