Skip to content

Commit d8f1201

Browse files
authored
Improve example specs (zircote#990)
* Improve exmple specs * Add spectral config file for spectral v6
1 parent 8dece41 commit d8f1201

File tree

6 files changed

+13
-17
lines changed

6 files changed

+13
-17
lines changed

.spectral.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
extends:
2+
- spectral:oas

Examples/example-object/example-object.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
* @OA\Schema(type="boolean")
6666
* },
6767
* @OA\Examples(example="result", value={"success": true}, summary="An result object."),
68-
* @OA\Examples(example="bool", value="false", summary="A boolean value."),
68+
* @OA\Examples(example="bool", value=false, summary="A boolean value."),
6969
* )
7070
* )
7171
* )

Examples/example-object/example-object.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ paths:
5858
value: { success: true }
5959
bool:
6060
summary: 'A boolean value.'
61-
value: 'false'
61+
value: false
6262
components:
6363
schemas:
6464
Result:
@@ -69,4 +69,3 @@ components:
6969
error:
7070
type: string
7171
type: object
72-

Examples/petstore-3.0/controllers/Pet.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,9 @@ public function updatePet()
8080
* required=true,
8181
* explode=true,
8282
* @OA\Schema(
83-
* type="array",
8483
* default="available",
85-
* @OA\Items(
86-
* type="string",
87-
* enum = {"available", "pending", "sold"},
88-
* )
84+
* type="string",
85+
* enum = {"available", "pending", "sold"},
8986
* )
9087
* ),
9188
* @OA\Response(

Examples/petstore-3.0/models/Order.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class Order
8282

8383
/**
8484
* @OA\Property(
85-
* default="false",
85+
* default=false,
8686
* format="int64",
8787
* description="Complete status",
8888
* title="Complete status",

Examples/petstore-3.0/petstore-3.0.yaml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,12 @@ paths:
6464
required: true
6565
explode: true
6666
schema:
67-
type: array
68-
items:
69-
type: string
70-
enum:
71-
- available
72-
- pending
73-
- sold
67+
type: string
7468
default: available
69+
enum:
70+
- available
71+
- pending
72+
- sold
7573
responses:
7674
'200':
7775
description: 'successful operation'
@@ -580,7 +578,7 @@ components:
580578
description: 'Complete status'
581579
type: boolean
582580
format: int64
583-
default: 'false'
581+
default: false
584582
type: object
585583
Pet:
586584
title: 'Pet model'

0 commit comments

Comments
 (0)