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

Added sponsor definition in Project Schema #721

Merged
merged 6 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions schema/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,36 @@
}
},
"additionalProperties": false
},
"sponsor": {
"type": "object",
"title": "Sponsor",
"description": "A project sponsor.",
"required": [
"name",
"url"
],
"properties": {
"description": {
"type": "string",
"description": "A brief description of the sponsor."
},
"logo": {
"type": "string",
"description": "The URL of the sponsor's logo.",
"format": "uri"
},
"name": {
"type": "string",
"description": "The name of the sponsor or organization."
},
"url": {
"type": "string",
"description": "The URL of the sponsor.",
"format": "uri"
}
},
"additionalProperties": false
}
},

Expand Down Expand Up @@ -92,6 +122,14 @@
"description": "The project pitch.",
"type": "string"
},
"sponsors": {
"description": "Sponsors of the project.",
"type": "array",
"items": {
"$ref": "#/$defs/sponsor"
},
"minItems": 1
},
"tags": {
"description": "Tags for the project",
"type": "array",
Expand Down
15 changes: 15 additions & 0 deletions schema/tests/data/project/negative/sponsors-empty-list.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
audience: breaker
leaders:
- github: leader-1-github
name: Leader 1 Name
- github: leader-2-github
name: Leader 2 Name
level: 2
name: OWASP Incubator Code Project
pitch: A very brief, one-line description of your project
tags:
- example-tag-1
- example-tag-2
- example-tag-3
type: code
sponsors: []
18 changes: 18 additions & 0 deletions schema/tests/data/project/negative/sponsors-name-missing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
audience: breaker
leaders:
- github: leader-name-1
name: Leader Name 1
- github: leader-name-2
name: Leader Name 2
level: 2
name: OWASP Incubator Code Project
pitch: A very brief, one-line description of your project
tags:
- example-tag-1
- example-tag-2
- example-tag-3
type: code
sponsors:
- description: A great sponsor
logo: https://sponsor1.com/logo.png
url: https://sponsor1.com
18 changes: 18 additions & 0 deletions schema/tests/data/project/negative/sponsors-url-missing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
audience: breaker
leaders:
- github: leader-1-github
name: Leader 1 Name
- github: leader-2-github
name: Leader 2 Name
level: 2
name: OWASP Incubator Code Project
pitch: A very brief, one-line description of your project
tags:
- example-tag-1
- example-tag-2
- example-tag-3
type: code
sponsors:
- description: A great sponsor
logo: https://sponsor1.com/logo.png
name: Sponsor 1
5 changes: 5 additions & 0 deletions schema/tests/data/project/positive/required-properties.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ leaders:
level: 2
name: OWASP Incubator Code Project
pitch: A very brief, one-line description of your project
sponsors:
- description: Sponsor 1 description
logo: https://sponsor1.com/logo.png
name: Sponsor 1
url: https://sponsor1.com
tags:
- example-tag-1
- example-tag-2
Expand Down
3 changes: 3 additions & 0 deletions schema/tests/project_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ def test_positive(project_schema):
),
("name-empty.yaml", "'' is too short"),
("name-none.yaml", "None is not of type 'string'"),
("sponsors-empty-list.yaml", "[] should be non-empty"),
("sponsors-name-missing.yaml", "'name' is a required property"),
("sponsors-url-missing.yaml", "'url' is a required property"),
],
)
def test_negative(project_schema, file_path, error_message):
Expand Down