Skip to content

fix(specs): name the WAF Conditions class instead of referencing it - #14267

Merged
ChiragAgg5k merged 1 commit into
mainfrom
fix/spec-waf-conditions-name
Oct 8, 2026
Merged

ChiragAgg5k merged 1 commit into
mainfrom
fix/spec-waf-conditions-name

Conversation

@ChiragAgg5k

@ChiragAgg5k ChiragAgg5k commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

#14266 added Utopia\WAF\Validator\Conditions::class to OpenAPI3 and the GraphQL mapper. utopia-php/waf isn't a dependency of this repository, so PHPStan reports it as class.notFound. The case now matches the class name as a string. That's the same comparison, since get_class() returns that string, and it doesn't reference a class that isn't installed. It also makes the Multiple comment generic.

Related: appwrite-labs/cloud#6413

@tenki-reviewer

tenki-reviewer Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Review complete. No issues found.


This change teaches the OpenAPI3 spec formatter to map a validator class to the correct string-typed schema, mirroring an equivalent case already present in the GraphQL type mapper.

Files Change
src/Appwrite/SDK/Specification/Format/OpenAPI3.php Adds a case branch mapping the WAF hostname validator to the proper string schema during spec generation.
src/Appwrite/GraphQL/Types/Mapper.php Adjusts the corresponding GraphQL type mapping so both spec surfaces agree on the validator-to-type mapping.

Reviewed commit: 1e33b77

@hansi-codes

hansi-codes Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

🟢 Tier S · Ready to merge

The class-name string comparisons preserve the prior runtime matching behavior while removing unavailable class references.

The GraphQL mapper and OpenAPI3 formatter now match the WAF Conditions validator by its fully qualified class-name string, avoiding a direct reference to a dependency unavailable in CE. The OpenAPI3 comment for array-typed Multiple validators was also updated to describe the emitted item schema.

Verdict New comments Fixed Still open
✅ Approved 0 0 0
📂 Walkthrough · 2
File Change
src/Appwrite/GraphQL/Types/Mapper.php Matches WAF Conditions by its class-name string when mapping GraphQL argument types.
src/Appwrite/SDK/Specification/Format/OpenAPI3.php Matches WAF Conditions by its class-name string and clarifies the Multiple validator schema comment.

Reviewed 7941952 · Details · Comment @hansi-codes review to re-run, or mention @hansi-codes with a question.

@hansi-codes hansi-codes Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Tier S · Looks good to merge. Summary

utopia-php/waf is not a dependency of this repository, so PHPStan reports Utopia\WAF\Validator\Conditions::class as an unknown class. Matching on the class name string keeps the case without the reference.
@ChiragAgg5k
ChiragAgg5k force-pushed the fix/spec-waf-conditions-name branch from 1e33b77 to 7941952 Compare October 8, 2026 13:29
@ChiragAgg5k
ChiragAgg5k merged commit b427096 into main Oct 8, 2026
2 checks passed
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown

Security rules

Scan did not complete. semgrep.json is missing or unreadable for this commit, so its findings are unknown. Check the Checks / Rules log: Semgrep install, rule fixtures, the ERROR proofs, or the scan itself failed.

Posted by Checks / Rules. Re-runs update this comment in place. Rule details and baseline: .semgrep/README.md.

@ChiragAgg5k ChiragAgg5k self-assigned this Oct 8, 2026
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