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
Improved enum and object property representation in JSON Schema
- Changed enum generation from $ref to inline enum with "type": "string" and explicit "enum" values
- Added proper nullable support for enums using ["string", "null"]
- Replaced invalid allOf usage for object types with correct $ref
- When nullable object, used oneOf with $ref and null type
The JSON Schema Generator is a PHP package that simplifies the generation of [JSON schemas](https://json-schema.org/) from Data Transfer Object (DTO) classes.
10
+
The JSON Schema Generator is a PHP package that simplifies the generation of [JSON schemas](https://json-schema.org/) from Data Transfer Object (DTO) classes.
11
11
It supports PHP enumerations and generic type annotations for arrays and provides an attribute for specifying title, description, and default value.
12
12
13
13
Main use case - structured output definition for LLMs.
@@ -107,39 +107,22 @@ Example array output:
107
107
'description' => [
108
108
'title' => 'Description',
109
109
'description' => 'The description of the movie',
110
-
'type' => 'string',
110
+
'type' => ['string', 'null'],
111
111
],
112
112
'director' => [
113
-
'type' => 'string',
113
+
'type' => ['string', 'null'],
114
114
],
115
115
'releaseStatus' => [
116
116
'title' => 'Release Status',
117
117
'description' => 'The release status of the movie',
0 commit comments