Skip to content

Commit 3df735c

Browse files
committed
resolve
2 parents c380286 + 3342097 commit 3df735c

11 files changed

Lines changed: 26 additions & 47 deletions

File tree

docs/docs.json

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,6 @@
5959
"json-schema/code-generation/from-enums",
6060
"json-schema/code-generation/from-json"
6161
]
62-
},
63-
{
64-
"group": "Validation",
65-
"pages": [
66-
"json-schema/validation/data-validation",
67-
"json-schema/validation/version-features"
68-
]
6962
}
7063
]
7164
}

docs/json-schema/installation.mdx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,9 @@ icon: 'terminal'
1313

1414
<Steps>
1515
<Step title="Install via Composer">
16-
Install the package using Composer with one of these commands:
17-
1816
```bash
1917
composer require cortexphp/json-schema
2018
```
21-
22-
<Check>
23-
Verify the package was installed by running: `composer show cortexphp/json-schema`
24-
</Check>
2519
</Step>
2620

2721
<Step title="Set Default Version (Optional)">

docs/json-schema/introduction.mdx

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -171,22 +171,3 @@ The package defaults to Draft 2020-12 for the latest features. Use Draft-07 for
171171
| `unevaluatedProperties` ||||
172172
| `dependentSchemas` ||||
173173
| `prefixItems` ||||
174-
175-
## Next Steps
176-
177-
<CardGroup cols={2}>
178-
<Card
179-
title="Get Started"
180-
icon="rocket"
181-
href="/json-schema/installation"
182-
>
183-
Install the package and create your first schema
184-
</Card>
185-
<Card
186-
title="Quick Start Guide"
187-
icon="bolt"
188-
href="/json-schema/quickstart"
189-
>
190-
Learn the basics with practical examples
191-
</Card>
192-
</CardGroup>

docs/json-schema/quickstart.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,9 @@ Use `toArray()` when you need to programmatically work with the schema structure
172172
$usernameSchema->isValid('john-doe'); // false (contains hyphen)
173173
```
174174

175-
<Check>
175+
<Tip>
176176
String schemas support patterns, length constraints, and format validation.
177-
</Check>
177+
</Tip>
178178
</Tab>
179179

180180
<Tab title="Array Validation">
@@ -193,9 +193,9 @@ Use `toArray()` when you need to programmatically work with the schema structure
193193
$tagsSchema->isValid([]); // false (too few items)
194194
```
195195

196-
<Check>
196+
<Tip>
197197
Array schemas can validate item types, count limits, and uniqueness.
198-
</Check>
198+
</Tip>
199199
</Tab>
200200

201201
<Tab title="Nested Objects">
@@ -215,9 +215,9 @@ Use `toArray()` when you need to programmatically work with the schema structure
215215
);
216216
```
217217

218-
<Check>
218+
<Tip>
219219
Object schemas support unlimited nesting and property requirements.
220-
</Check>
220+
</Tip>
221221
</Tab>
222222
</Tabs>
223223

@@ -227,7 +227,7 @@ You can also use schema classes directly instead of the factory:
227227

228228
<CodeGroup>
229229

230-
```php Factory Method (Recommended)
230+
```php Factory Method
231231
use Cortex\JsonSchema\Schema;
232232

233233
$schema = Schema::string('name')

docs/json-schema/schema-types/boolean.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,4 +400,3 @@ $booleanSchema->isValid(false); // true
400400
Track record states, completion status, and operational flags.
401401
</Card>
402402
</CardGroup>
403-

docs/json-schema/schema-types/number.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ try {
295295
## Number vs Integer
296296

297297
<Info>
298-
Numbers can be integers or floating-point values. If you specifically need integer validation, use [Integer Schema](/schema-types/integer) instead.
298+
Numbers can be integers or floating-point values. If you specifically need integer validation, use [Integer Schema](/json-schema/schema-types/integer) instead.
299299
</Info>
300300

301301
```php

docs/json-schema/schema-types/string.mdx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,6 @@ Set minimum and maximum character limits for your strings:
6464
```
6565
</Expandable>
6666

67-
<Check>
68-
Length constraints help ensure data fits database fields and meets business requirements.
69-
</Check>
70-
7167
## Pattern Matching
7268

7369
Use regular expressions to validate string patterns:

docs/json-schema/schema-types/union.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,4 +413,3 @@ $shapeSchema = Schema::union([SchemaType::Object], 'shape')
413413
Model data structures with multiple possible shapes or types.
414414
</Card>
415415
</CardGroup>
416-

src/Contracts/JsonSchema.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ public function title(string $title): static;
1818
*/
1919
public function getTitle(): ?string;
2020

21+
/**
22+
* Determine if the schema has a title
23+
*/
24+
public function hasTitle(): bool;
25+
2126
/**
2227
* Set the description
2328
*/

src/Types/Concerns/HasProperties.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,11 @@ public function hasRequiredProperties(): bool
254254
public function requireAll(): static
255255
{
256256
foreach ($this->properties as $property) {
257-
$property->required();
257+
$title = $property->getTitle();
258+
259+
if ($title !== null) {
260+
$this->requiredProperties[] = $title;
261+
}
258262
}
259263

260264
return $this;

0 commit comments

Comments
 (0)