-
Notifications
You must be signed in to change notification settings - Fork 525
satis.json schema #271
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
satis.json schema #271
Conversation
"minimum-stability": { | ||
"type": ["string"], | ||
"description": "The minimum stability the packages must have to be install-able. Possible values are: dev, alpha, beta, RC, stable.", | ||
"pattern": "^dev|alpha|beta|rc|RC|stable$" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using enum
would be simpler
It would probably be a good idea to validate the schema on every run. Not necessarily fail the run, but at least print out errors/warnings to notify the user. |
"require": { | ||
"type": "object", | ||
"description": "This is a hash of package name (keys) and version constraints (values) that are required to run this package.", | ||
"additionalProperties": true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rather than true
, this should use a schema object here, to force all additional properties to contain strings
You are missing the |
@stof, i completely agree about What I mean is that it would be preferable Composer manages its definitions and then Satis could use it. How do you feel about this ? I have no idea how to set "abandoned" : {
"vendor/name": true,
"vendor/othername": "othervendor/othername",
...
} It's clearly an object, but how to specify its properties ? @alcohol. Yep, it's the idea I have in mind. But for now, il would be a lot a duplicate code between Composer and Satis. |
@JamesRezo |
if you don't add it at all, you forbid defining it in the satis config, which is wrong. |
Sorry for the name mismatch :-) |
} | ||
} | ||
}, | ||
"extra": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra
does not make sense in the Satis config
/cc @Seldaek got any feedback regarding this schema? |
if (!$skipErrors) { | ||
throw $e; | ||
} | ||
$output->writeln(sprintf("<error>Skipping Exception '%s'.</error>", $e->getMessage())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to use warning instead of error I think, since $skipErrors
basically downgrades them. Don't need the pre-text either then, just the exception. E.g. sprintf('<warning>%s: %s</warning>', get_class($e), $e->getMessage())
.
Is there something blocking yet ? |
No, I'll merge it, and if anything pops up I expect a new PR :-) |
looks like this change made "homepage" key required, and it was not easy to figure out WHY the validation failed (the error is not self-explanatory). i had pretty much test each option to figure out what made validation to fail...
|
also, "name" seems to be required now, i had repo without name working fine before (generated without html output), and even now the name seems to be optional so i'd send PR to make "name" and "homepage" optional again, ok? |
Well, the BuildCommand should display validation errors properly (the JsonValidationException contains some details) |
This is a proposal for a satis file validation schema.
It can be tested with https://github.com/justinrainbow/json-schema :