Skip to content

Move schema tests#47

Closed
edevsh wants to merge 4 commits intocorebranch:1.xfrom
edevsh:move-schema-tests
Closed

Move schema tests#47
edevsh wants to merge 4 commits intocorebranch:1.xfrom
edevsh:move-schema-tests

Conversation

@edevsh
Copy link
Member

@edevsh edevsh commented Oct 13, 2025

No description provided.

@edevsh edevsh self-assigned this Oct 13, 2025
@edevsh edevsh closed this Oct 13, 2025
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting

Comment on lines +36 to +40
foreach ($properties as $childPropertyName => $childProperty) {
$childProperty = new Property(
$childPropertyName,
new Schema($childProperty),
in_array($childPropertyName, $nullable, true),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Instantiate Schema with SchemaInterface instance

The loop now receives SchemaInterface instances from ObjectSchema::properties(), but the code still wraps each one with new Schema($childProperty) where the Schema constructor requires an array. When any object has nested properties this call will throw a TypeError instead of generating components. Use the schema object directly or convert it with toArray() before constructing a new Schema.

Useful? React with 👍 / 👎.

Comment on lines +95 to +100
foreach($properties as $propertyName => $property) {
$property = new Property(
$propertyName,
new Schema($property->toArray()),
in_array($property, $nullable, true),
in_array($property, $required, true)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Nullable/required checks compare schema objects to names

Within generate(), $nullable and $required are arrays of property names from the schema, but the loop compares them with $property, which is the schema object, via in_array($property, $nullable, true) and in_array($property, $required, true). These comparisons always fail, so every generated Property is treated as not nullable and not required. The comparison should use $propertyName to correctly flag properties.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant