composer / composer

Dependency Manager for PHP

Home Page:https://getcomposer.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Update schema for version value

maks-oleksyuk opened this issue · comments

According to the documentation, you can specify the following options:

  • 1.0.0-dev
  • 1.0.0-alpha3
  • 1.0.0-beta2
  • 1.0.0-RC5
  • v2.0.4-p1

However, the json schema does not follow this format.

"pattern": "^v?\\d+(\\.\\d+){0,3}|^dev-"

Need to change the schema and add support for the following suffixes: -dev, -patch (-p), -alpha (-a), -beta (-b), -RC

The schema regex only enforces the beginning looks correct, it has no $ marking the end of string so all your versions are valid. I don't really want to duplicate complex regex here and risk having it wrong or outdated, thats why the schema takes a lax approach to just validate basics are correct.