diff --git a/Examples/using-refs/ProductController.php b/Examples/using-refs/ProductController.php index 5d22ba955..6725beebd 100644 --- a/Examples/using-refs/ProductController.php +++ b/Examples/using-refs/ProductController.php @@ -17,8 +17,7 @@ class ProductController * path="/products/{product_id}", * @OA\Response( * response="default", - * description="successful operation", - * @OA\JsonContent(ref="#/components/responses/product") + * ref="#/components/responses/product" * ) * ) */ @@ -33,8 +32,7 @@ public function getProduct($id) * @OA\RequestBody(ref="#/components/requestBodies/product_in_body"), * @OA\Response( * response="default", - * description="successful operation", - * @OA\JsonContent(ref="#/components/responses/product") + * ref="#/components/responses/product" * ) * ) */ @@ -46,11 +44,10 @@ public function updateProduct($id) * @OA\Post( * tags={"Products"}, * path="/products", - * @OA\Parameter(ref="#/components/requestBodies/product_in_body"), + * @OA\RequestBody(ref="#/components/requestBodies/product_in_body"), * @OA\Response( * response="default", - * description="successful operation", - * @OA\JsonContent(ref="#/components/responses/product") + * ref="#/components/responses/product" * ) * ) */ diff --git a/Examples/using-refs/using-refs.yaml b/Examples/using-refs/using-refs.yaml index 233e637a5..aaf431acd 100644 --- a/Examples/using-refs/using-refs.yaml +++ b/Examples/using-refs/using-refs.yaml @@ -10,11 +10,7 @@ paths: operationId: 133f11c148f628647767a323bf78c68d responses: default: - description: 'successful operation' - content: - application/json: - schema: - $ref: '#/components/responses/product' + $ref: '#/components/responses/product' patch: tags: - Products @@ -23,11 +19,7 @@ paths: $ref: '#/components/requestBodies/product_in_body' responses: default: - description: 'successful operation' - content: - application/json: - schema: - $ref: '#/components/responses/product' + $ref: '#/components/responses/product' parameters: - $ref: '#/components/parameters/product_id_in_path_required' @@ -36,16 +28,11 @@ paths: tags: - Products operationId: 779b6345f19f6b865527e6bd67819d2d - parameters: - - - $ref: '#/components/requestBodies/product_in_body' + requestBody: + $ref: '#/components/requestBodies/product_in_body' responses: default: - description: 'successful operation' - content: - application/json: - schema: - $ref: '#/components/responses/product' + $ref: '#/components/responses/product' components: schemas: Product: diff --git a/composer.json b/composer.json index 16a39c2e6..f3dbad7f6 100644 --- a/composer.json +++ b/composer.json @@ -72,7 +72,10 @@ "@phpstan", "@psalm" ], - "validate-examples": "for ff in `find Examples -name *.yaml`; do spectral lint $ff; done", + "validate-examples": { + "spectral": "for ff in `find Examples -name *.yaml`; do spectral lint $ff; done", + "swagger-cli": "for ff in `find Examples -name *.yaml`; do swagger-cli validate $ff; done" + }, "docs": "./docs/node_modules/.bin/vuepress dev docs/", "deploy_docs": "./docs/node_modules/.bin/vuepress build docs/ && cp -r .git docs/.vuepress/dist/.git && cd docs/.vuepress/dist/ && git symbolic-ref HEAD refs/heads/gh-pages && git add --all" }