OpenAPI 3.0 spec pattern constant validation

オープン
#57 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
42/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
python

調査の方向性

No file or test is named in the issue. Start by reproducing the validator behavior with the two pattern examples, then locate the OpenAPI 3.0 pattern validation entry point. Done means slash-delimited ECMA 262 patterns are accepted while the undelimited form is rejected.

索引モデルが issue の本文から書いたものです。

説明

Description

According to the OpenAPI 3.0 specification for the pattern attribute of a schema object, the pattern provided should comply with ECMA 262 regular expression syntax. The syntax defined in that specification defines regular expression literals as being preceded and trailed by a '/' character, as they are in Javascript/ECMAscript.

Expected behaviour

Pattern specified in a specification as:

pattern: /regular expression/

should be valid, patterns specified without the leading and trailing '/' characters should not.

Actual Behavior

Both

pattern: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/

and

pattern: ^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$

are valid pattern constants according to the validator. The second should not be valid, unless I'm misreading the two specification documents linked above.

This is a follow up on Connexion issue number 871.

主要言語
Python
スター
409
フォーク
73
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

python-openapi/openapi-spec-validator のほかの issue

python-openapi/openapi-spec-validator の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。