From eb0ee6a9a19c5e49e095eddd9968c4e0b404e8bc Mon Sep 17 00:00:00 2001 From: chris48s Date: Fri, 25 Mar 2022 18:44:47 +0000 Subject: [PATCH] fix [pypi] badges when package has null license (#7761) Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com> --- services/pypi/pypi-base.js | 3 ++- services/pypi/pypi-helpers.spec.js | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/services/pypi/pypi-base.js b/services/pypi/pypi-base.js index e19d6e23a5..a25ed787b4 100644 --- a/services/pypi/pypi-base.js +++ b/services/pypi/pypi-base.js @@ -5,7 +5,8 @@ const schema = Joi.object({ info: Joi.object({ version: Joi.string().required(), // https://github.com/badges/shields/issues/2022 - license: Joi.string().allow(''), + // https://github.com/badges/shields/issues/7728 + license: Joi.string().allow('').allow(null), classifiers: Joi.array().items(Joi.string()).required(), }).required(), releases: Joi.object() diff --git a/services/pypi/pypi-helpers.spec.js b/services/pypi/pypi-helpers.spec.js index eca6fed39b..bb86c37955 100644 --- a/services/pypi/pypi-helpers.spec.js +++ b/services/pypi/pypi-helpers.spec.js @@ -104,6 +104,12 @@ describe('PyPI helpers', function () { 'MIT', ]) forCases([ + given({ + info: { + license: null, + classifiers: ['License :: OSI Approved :: MIT License'], + }, + }), given({ info: { license: '',