From 82ea1bea37426daf3c5defe5da1352284a85eeeb Mon Sep 17 00:00:00 2001 From: Manya Sharma <214554783+ManyaS-Git@users.noreply.github.com> Date: Sat, 15 Aug 2026 09:40:48 +0530 Subject: [PATCH] Fix invalid JSON Schema in listing_config_schema.json The schema declares \ draft/2020-12 but was not valid against that meta-schema (21 violations): - offer_listing fields used the non-existent type 'list'; these are lists of contacts, URIs, logos, screenshots and videos, so the correct type is 'array'. - plan_overview was malformed: items.properties contained a nested {'type': 'array', 'items': {...}} wrapper holding the real plan object, and a duplicate copy was also placed at the array level under a meaningless 'properties' keyword. The real plan properties (plan_listing, pricing_and_availability, technical_configuration) are now declared directly under items.properties, and the duplicated array-level block is removed. Verified with the jsonschema validator: - The old schema was INVALID per its declared meta-schema and silently accepted malformed plan data (e.g. plan_listing: 123). - The fixed schema passes check_schema (0 violations), validates a realistic configuration instance, and correctly rejects invalid plan data. --- .ci/listing_config_schema.json | 268 ++++++++++----------------------- 1 file changed, 80 insertions(+), 188 deletions(-) diff --git a/.ci/listing_config_schema.json b/.ci/listing_config_schema.json index 5299039..aae41ce 100644 --- a/.ci/listing_config_schema.json +++ b/.ci/listing_config_schema.json @@ -59,19 +59,19 @@ "maxLength": 3 }, "listing_contacts" : { - "type": "list" + "type": "array" }, "listing_uris" : { - "type": "list" + "type": "array" }, "listing_logos" : { - "type": "list" + "type": "array" }, "listing_screenshots": { - "type": "list" + "type": "array" }, "listing_videos" : { - "type": "list" + "type": "array" } }, "required" : [ @@ -120,207 +120,99 @@ "items" : { "type" : "object", "properties": { - "type" : "array", - "items": { + "plan_listing" : { "type" : "object", "properties": { - "plan_listing" : { - "type" : "object", - "properties": { - "title" : { - "type": "string" - }, - "summary" : { - "type": "string" - }, - "description": { - "type": "string" - } - } + "title" : { + "type": "string" }, - "pricing_and_availability": { - "type" : "object", - "properties": { - "visibility" : { - "type": "string", - "enum": [ - "private", - "public" - ] - }, - "azure_private_subscriptions": { - "type" : "array", - "items": { - "type" : "object", - "properties": { - "ID" : { - "type": "string" - }, - "Description": { - "type": "string" - } - }, - "required" : [ - "ID" - ] - } - } - } + "summary" : { + "type": "string" }, - "technical_configuration" : { - "type" : "object", - "properties": { - "version" : { - "type": "string" - }, - "allowedCustomerActions": { - "type" : "array", - "items" : { + "description": { + "type": "string" + } + } + }, + "pricing_and_availability": { + "type" : "object", + "properties": { + "visibility" : { + "type": "string", + "enum": [ + "private", + "public" + ] + }, + "azure_private_subscriptions": { + "type" : "array", + "items": { + "type" : "object", + "properties": { + "ID" : { "type": "string" }, - "maxLength": 1 - }, - "allowedDataActions" : { - "type" : "array", - "items" : { + "Description": { "type": "string" - }, - "maxLength": 1 - }, - "tenant_id" : { - "type": "string" - }, - "authorizations" : { - "type" : "array", - "items" : { - "type" : "object", - "properties": { - "id" : { - "type": "string" - }, - "role": { - "type": "string", - "enum": [ - "Owner", - "Contributor" - ] - } - } - }, - "minLength": 1, - "maxLength": 10 + } }, - "policy_settings" : { - "type": "array" - } - }, - "required" : [ - "version" - ] - } - } - } - } - }, - "properties" : { - "type" : "array", - "items": { - "type" : "object", - "properties": { - "plan_listing" : { - "type" : "object", - "properties": { - "title" : { - "type": "string" - }, - "summary" : { - "type": "string" - }, - "description": { - "type": "string" - } - } - }, - "pricing_and_availability": { - "type" : "object", - "properties": { - "visibility" : { - "type": "string", - "enum": [ - "private", - "public" + "required" : [ + "ID" ] - }, - "azure_private_subscriptions": { - "type" : "array", - "items": { - "type" : "object", - "properties": { - "ID" : { - "type": "string" - }, - "Description": { - "type": "string" - } - }, - "required" : [ - "ID" - ] - } } } - }, - "technical_configuration" : { - "type" : "object", - "properties": { - "version" : { + } + }, + "technical_configuration" : { + "type" : "object", + "properties": { + "version" : { + "type": "string" + }, + "allowedCustomerActions": { + "type" : "array", + "items" : { "type": "string" }, - "allowedCustomerActions": { - "type" : "array", - "items" : { - "type": "string" - }, - "maxLength": 1 - }, - "allowedDataActions" : { - "type" : "array", - "items" : { - "type": "string" - }, - "maxLength": 1 - }, - "tenant_id" : { + "maxLength": 1 + }, + "allowedDataActions" : { + "type" : "array", + "items" : { "type": "string" }, - "authorizations" : { - "type" : "array", - "items" : { - "type" : "object", - "properties": { - "id" : { - "type": "string" - }, - "role": { - "type": "string", - "enum": [ - "Owner", - "Contributor" - ] - } + "maxLength": 1 + }, + "tenant_id" : { + "type": "string" + }, + "authorizations" : { + "type" : "array", + "items" : { + "type" : "object", + "properties": { + "id" : { + "type": "string" + }, + "role": { + "type": "string", + "enum": [ + "Owner", + "Contributor" + ] } - }, - "minLength": 1, - "maxLength": 10 + } }, - "policy_settings" : { - "type": "array" - } + "minLength": 1, + "maxLength": 10 }, - "required" : [ - "version" - ] - } + "policy_settings" : { + "type": "array" + } + }, + "required" : [ + "version" + ] } } }