diff --git a/schema/project.json b/schema/project.json index a9b04c128..c502abcee 100644 --- a/schema/project.json +++ b/schema/project.json @@ -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 } }, @@ -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", diff --git a/schema/tests/data/project/negative/sponsors-empty-list.yaml b/schema/tests/data/project/negative/sponsors-empty-list.yaml new file mode 100644 index 000000000..af9e922ef --- /dev/null +++ b/schema/tests/data/project/negative/sponsors-empty-list.yaml @@ -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: [] diff --git a/schema/tests/data/project/negative/sponsors-name-missing.yaml b/schema/tests/data/project/negative/sponsors-name-missing.yaml new file mode 100644 index 000000000..ba2980fb5 --- /dev/null +++ b/schema/tests/data/project/negative/sponsors-name-missing.yaml @@ -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 diff --git a/schema/tests/data/project/negative/sponsors-url-missing.yaml b/schema/tests/data/project/negative/sponsors-url-missing.yaml new file mode 100644 index 000000000..3d21bf5af --- /dev/null +++ b/schema/tests/data/project/negative/sponsors-url-missing.yaml @@ -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 diff --git a/schema/tests/data/project/positive/required-properties.yaml b/schema/tests/data/project/positive/required-properties.yaml index ddc7a5aee..b6bfa0875 100644 --- a/schema/tests/data/project/positive/required-properties.yaml +++ b/schema/tests/data/project/positive/required-properties.yaml @@ -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 diff --git a/schema/tests/project_test.py b/schema/tests/project_test.py index 963013ea6..696f66aa1 100644 --- a/schema/tests/project_test.py +++ b/schema/tests/project_test.py @@ -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):