Fix invalid JSON Schema in listing_config_schema.json - #191
Open
Manya Sharma (ManyaS-Git) wants to merge 1 commit into
Open
Fix invalid JSON Schema in listing_config_schema.json#191Manya Sharma (ManyaS-Git) wants to merge 1 commit into
Manya Sharma (ManyaS-Git) wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.ci/listing_config_schema.jsondeclares$schema: https://json-schema.org/draft/2020-12/schema, but it was not valid against that meta-schema. Validating with thejsonschemalibrary surfaced 21 meta-schema violations, from two distinct problems:1.
"type": "list"is not a valid JSON Schema type (offer_listing)The
listing_contacts,listing_uris,listing_logos,listing_screenshotsandlisting_videosfields used"type": "list".listis not a valid JSON Schema type — these are collections, so the correct type is"array".2.
plan_overviewwas structurally malformeditems.propertiescontained a nested{"type": "array", "items": {...}}wrapper that held the actual plan object, so the property namestype/itemswere treated as schema properties and the real plan properties were never applied.propertieskeyword, which is meaningless on anarrayschema and was silently ignored.The real plan properties (
plan_listing,pricing_and_availability,technical_configuration) are now declared directly underitems.properties, and the duplicated array-level block is removed.Verification (with the
jsonschemalibrary, draft 2020-12)plan_listing: 123)This means the schema now actually constrains the plan data it was meant to describe instead of accepting anything.