-
Notifications
You must be signed in to change notification settings - Fork 357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add support for Draft 6 in NumberConstraint #706
base: master
Are you sure you want to change the base?
Conversation
Thank you very much for this PR! As you've noticed, we are indeed extremely short on people with available time. A few points:
@Seldaek Do you have an opinion on (4)? If this violation would trouble composer (or if you aren't sure), then I won't backport it. You're too important to break ;-) |
Hey! Thank you for looking at this so soon. Since you used numbers, I will use numbers too 😄
From @erayd comment above it looks like it is safe to require master as a version rather than |
I'm really not familiar enough with the draft 04 vs 06 changes, but I doubt this impacts Composer. We only have a few integer types defined and none of them have additional restrictions. From a "requiring master" perspective, it'd be good if we changed https://github.com/justinrainbow/json-schema/blob/master/composer.json#L41 to be 6.x-dev @erayd - that way projects requiring the draft 06 could require this package as |
I'd be really nice to move forward on this and trying to align this software versions with each draft would be a must! Just target
Do you need help for maintenance? From what I see the |
Always. Much to do, and no time to do it in.
The master branch already implements draft-06, and should be essentially feature-complete. This PR caught something that both we and the unit tests missed, but is an exception rather than the rule.
Absolutely not. This library needs to be backwards-compatible with much older versions of PHP unfortunately - we support all the way back to PHP 5.3. Requiring PHP 8 as a minimum version for the v6 branch will never happen; it would break too many dependent projects. |
@erayd I can update this PR against master now. Do you want to keep both Draft 4 and 6 or just move to 6 and never look back? |
Both, please. Many people use v4 still. |
@erayd I am sure this is about more than Composer, but from my/Composer perspective, PHP 7.2+ is alright now, as long as v5 is kept maintained for critical fixes (but I really don't expect much of that, and I can do it myself if needed), and most likely the next jump we would do would be PHP 8.1+ to be able to use Symfony components in their |
My opinion on this is that the Draft 6 version of this package should move on at least php 7 or 8 version, I don't understand why supporting older versions would be a benefit (as it's a maintenance burden anyway). You could always use the To follow @llupa's enhancement here, you should target |
If you are happy to do backports, then I'm OK with moving the minimum for master to PHP 7.2 at some point. I don't want to leave those still using legacy PHP 5.x applications out in the cold though, as I'm aware of a number of them that use the master branch in order to obtain draft-06 support - so while the 5.x.x branch might be enough for composer's legacy requirements, it isn't the full picture. If we go down that path, I'd like to see an additional "fixes only" branch forked off of master that will maintain PHP-5.6+ support (perhaps as a v6 release branch, with master becoming v7). Somebody will need to take on the responsibility of backports for that branch, as I don't have the time for more than the occasional item. If there is appetite to pick up significant development work on this library that necessitates a higher minimum version, I'm open to persuasion. However the reality is that it's currently on life-support, so such a change would be a rather arbitrary restriction - I'm not seeing that the gains are worth it at this point. Feel free to convince me otherwise 🙂.
No. The master branch was always intended to support both, and has been used accordingly. Suddenly dropping support for draft-04 isn't acceptable. Better separation between versions of the spec would be a good thing though, ideally making proper use of the |
v4 of this library has been unmaintained for many years. It should be avoided; there are a number of known significant problems with it. For users who require an older version of PHP, and for whom draft-04 is acceptable, then the v5.x.x release branch is usually the right choice. For users who require draft-06, regardless of PHP version, v6.x.x (master branch) is currently their only option. |
@erayd I moved the PR to master, but GitHub Actions did not pick up my force push. I wanted to have Alternatively here is the commit and GA over my fork. |
@llupa thanks for your efforts and sticking strong with all the rebasing and other comments. In an attempt to revive this library I'm doing some triage on the issues and pull requests. With regards to your commit not being picked up by GitHub workflow I can recommend doing a @erayd I see you mentioning:
Does this perhaps mean that the json schema test suite is really do for some updating? Also since the version |
@DannyvdSluijs funny you wrote today. I was thinking about this PR over the weekend 😅 Workflows waiting to be started 👍 |
I am opening this PR because I first encountered it as reported in api-platform/core#6041. I have read and seen either via commit history or issues (such as #699) that this repository has very limited people capabilities.
I tried to keep this as short as possible to offer a Draft 4 and Draft 6 compliance for Numbers->Range case without changing too much. Ref: Draft 6 Backward-incompatible changes.
I don't know if an
is_bool
is fine vsfilter_var
, I am more than happy to apply changes as per your feedback.