You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,9 @@ Copy the `json-schema.php` file from the `vendor/carsdotcom/laravel-json-schema/
45
45
46
46
#### Generate Enum Schemas
47
47
48
-
This is an optional step, but can be super helpful.
48
+
_This is an optional step, but can be super helpful._
49
+
50
+
Note: Enums must be created either as a built-in PHP `enum` object or a `MyCLabs\Enum\Enum` class.
49
51
50
52
1. Add `use Carsdotcom\JsonSchemaValidation\Traits\GeneratesSchemaTrait;` to the declarations in the Enum.
51
53
2. Add a `SCHEMA` constant to the enum. It's value will be the relative path to your schema file, such as: `const SCHEMA = '/Acme/Enums/item_type.json';`
0 commit comments