What kind of issue is this?
Configuration
PlatformIO Version: 6.1.19
Description of problem
When a dependency entry in library.json specifies an URL instead of a SemVer, the version value is validated with the max=100 length constraint used for normal SemVer strings:
# platformio/package/manifest/schema.py
class DependencySchema(StrictSchema):
owner = fields.Str(validate=validate.Length(min=1, max=100))
name = fields.Str(required=True, validate=validate.Length(min=1, max=100))
version = fields.Str(validate=validate.Length(min=1, max=100))
This is fine for actual version strings, but an URL can sometimes exceed 100 characters.
Steps to Reproduce
- Create a
library.json with a dependency that has no owner, and a version that is a long URL (>100 chars):
{
"name": "ExampleLib",
"version": "1.0.0",
"dependencies": [
{
"name": "external-dep",
"version": "https://github.com/some-org/some-repository/releases/download/some-long-prelease-version/some-long-binary-name.zip"
}
]
}
- Run
pio pkg pack.
Actual Results
ManifestValidationError: Invalid manifest fields: {'dependencies': {0: {'version': ['Length must be between 1 and 100.']}}}.
Please check specification -> https://docs.platformio.org/page/librarymanager/config.html
So does with an actual URL.
Expected Results
This should be valid because version field maybe adheres to Remote TAR or ZIP archive spec when it is indicating a package specification, and other URL-compatible fields are mostly validated with max=255 such as:
# Class ManifestSchema
downloadUrl = fields.Url(validate=validate.Length(min=1, max=255))
What kind of issue is this?
Configuration
PlatformIO Version: 6.1.19
Description of problem
When a dependency entry in
library.jsonspecifies an URL instead of a SemVer, theversionvalue is validated with themax=100length constraint used for normal SemVer strings:This is fine for actual version strings, but an URL can sometimes exceed 100 characters.
Steps to Reproduce
library.jsonwith a dependency that has noowner, and aversionthat is a long URL (>100 chars):{ "name": "ExampleLib", "version": "1.0.0", "dependencies": [ { "name": "external-dep", "version": "https://github.com/some-org/some-repository/releases/download/some-long-prelease-version/some-long-binary-name.zip" } ] }pio pkg pack.Actual Results
ManifestValidationError: Invalid manifest fields: {'dependencies': {0: {'version': ['Length must be between 1 and 100.']}}}. Please check specification -> https://docs.platformio.org/page/librarymanager/config.htmlSo does with an actual URL.
Expected Results
This should be valid because
versionfield maybe adheres to Remote TAR or ZIP archive spec when it is indicating a package specification, and other URL-compatible fields are mostly validated withmax=255such as: