Skip to content
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

download attribute in project schema #713

Merged
merged 10 commits into from
Feb 4, 2025
11 changes: 11 additions & 0 deletions schema/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,17 @@
"format": "uri",
"type": "string"
},
"downloads": {
"description": "Optional list of download URLs.",
"type": "array",
"items": {
"type": "string",
"format": "uri"
},
"minItems": 1,
"uniqueItems": true,
"optional": true
},
"events": {
"description": "Event URLs related to the project.",
"type": "array",
Expand Down
13 changes: 13 additions & 0 deletions schema/tests/data/project/negative/downloads-empty.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
audience: builder
downloads: []
name: "Test Project"
level: 3
leaders:
- github: "testuser1"
- github: "testuser2"
pitch: A very brief, one-line description of your project
tags:
- example-tag-1
- example-tag-2
- example-tag-3
type: code
15 changes: 15 additions & 0 deletions schema/tests/data/project/negative/downloads-non-unique.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
audience: builder
downloads:
- https://abc.com/download
- https://abc.com/download
name: "Test Project"
level: 3
leaders:
- github: "testuser1"
- github: "testuser2"
pitch: A very brief, one-line description of your project
tags:
- example-tag-1
- example-tag-2
- example-tag-3
type: code
3 changes: 3 additions & 0 deletions schema/tests/data/project/positive/optional-properties.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
audience: breaker
demo: https://some-demo-url.com
downloads:
- https://abc.com/download1
- https://abc.com/download2
events:
- 'https://example.com/event1'
- 'https://example.com/event2'
Expand Down
5 changes: 5 additions & 0 deletions schema/tests/project_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ def test_positive(project_schema):
("audience-empty.yaml", "'' is not one of ['breaker', 'builder', 'defender']"),
("audience-missing.yaml", "'audience' is a required property"),
("demo-none.yaml", "None is not of type 'string'"),
("downloads-empty.yaml", "[] should be non-empty"),
(
"downloads-non-unique.yaml",
"['https://abc.com/download', 'https://abc.com/download'] has non-unique elements",
),
("events-empty.yaml", "[] should be non-empty"),
(
"events-non-unique-urls.yaml",
Expand Down