Replies: 1 comment
|
I tested the attached import json
from jsonschema import Draft201909Validator
with open("schema.json", encoding="utf-8") as f:
schema = json.load(f)
product = {
"footwear_size": [{
"size": "one_size",
"size_class": "numeric",
"size_system": "eu_footwear_size_system",
}]
}
for error in Draft201909Validator(schema).iter_errors(product):
if list(error.absolute_path)[:1] == ["footwear_size"]:
print(f"{error.json_path}: {error.message}")Output for that field: The For your first question, a This checks the standard 2019-09 keywords. Amazon's extra validation keywords, such as |
Uh oh!
There was an error while loading. Please reload this page.
I am try to validate product data json with Amazon Product Type Definitions schema. but I have two problems.
First One: This is part of footwear_size property, there is 3 attribute are required. size, size_class, size_system.
I check the amazon documents they says ve ara use 2019-09 schema then i use Draft201909Validator for validating. ( also i try another ones.)
First Problem is ValidationError return only base attribute 3 time footwear_size, i cant see size, size_class, size_system attributes.
Second Is: schema says if size_system == eu_footwear_size_system then required age_group. But age_group not appear required errors.
Here is product data json part.
Here is schema if then part.
and i am attaching full schema.
schema.json
Any one can help me ?
All reactions