[Question] Use the rule patterns somewhere else
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 需要澄清
- 活跃度
- 冷清
- 技术栈
- openapi, php
调研方向
从 Intervention\Validation\Rules\Postalcode 及其 private pattern 函数开始,然后查看 issue 中的 OpenAPI Property 示例。确定 package 是否应为 API 文档公开该 rule pattern,同时不要求重复的硬编码值;当预期的实现方式及其行为已有文档说明或由适当的测试覆盖时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
Hi! First of all, thank you for creating this package, it’s really helpful!
My problem
We’re building an application that processes user information, and we use the PostalCode rule to validate the postal codes provided in requests. The validation itself works perfectly, but I’m struggling with one thing: I’m generating a Swagger (OpenAPI) documentation for our APIs, and in it, I’d like to specify a pattern for the postal code like this:
new OA\Property(
property: 'postal_code',
type: 'string',
pattern: '^\d{4}[A-Z]{2}$'
),
But now I want to match the pattern used in Intervention\Validation\Rules\Postalcode, which seems a bit difficult. Besides, the pattern function is private, and it doesn't seem to accept functions in the Swagger documentation anyway. I'm currently using a public constant or an enum.
My questions
Has anyone had the same problem in the past? Did you solve it in some way, or did you just hardcode the pattern in your docs and hope it never changes within the package? Is there a way to fetch the pattern(s) that I just didn't see before?
Hope someone can help me out, Thnx
- 主要语言
- PHP
- 星标
- 678
- 派生
- 68
- 平均合并
- 9 分钟
- 30 天内合并 PR
- 1
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Intervention/validation 的其他 Issue
-
investigation-needed patch-release
难度 4/5 3-5 天 新手友好度 35/100
Intervention/validation#59 · 5 条评论 ·
查看 Intervention/validation 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 79/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 69/100
bagisto/bagisto-api#54 ·
-
难度 2/5 1-3 小时 新手友好度 64/100
维护者通常 5 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
grokability/snipe-it#19869 · 2 条评论 ·
维护者通常 1 天内回复
-
regression
难度 2/5 1-3 小时 新手友好度 70/100