[Question] Use the rule patterns somewhere else
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- 説明が足りない
- 活発さ
- 静か
- 技術スタック
- openapi, php
調査の方向性
Intervention\Validation\Rules\Postalcode とその private な pattern 関数から始め、その後 issue の OpenAPI Property の例を確認します。重複したハードコード値を要求せずに API ドキュメント用の rule pattern を package が公開すべきかどうかを判断します。意図したアプローチとその動作が文書化されるか、適切なテストでカバーされれば完了です。
索引モデルが 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分
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Intervention/validation のほかの issue
-
investigation-needed patch-release
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
Intervention/validation#59 · コメント 5 件 ·
Intervention/validation の issue をすべて見る
似ている issue
-
InvoiceSettled is answered 200 when the invoice cannot be re-fetched, so BTCPay never redelivers itオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
btcpayserver/woocommerce-greenfield-plugin#93 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
opnsense/core#11052 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
grokability/snipe-it#19857 ·
メンテナーはふだん 1 日以内に返信