Skip to content

Commit

Permalink
CXP-1300: remove & from schema
Browse files Browse the repository at this point in the history
  • Loading branch information
tseho committed Sep 22, 2022
1 parent 8837d81 commit dc99e15
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@
},
"$defs": {
"$id": {
"$ref": "#/$defs/uriReferenceString",
"$comment": "Non-empty fragments not allowed.",
"pattern": "^[^#]*#?$"
},
"$ref": { "$ref": "#/$defs/uriReferenceString" },
"$schema": { "$ref": "#/$defs/uriString" },
"$comment": {
"type": "string"
Expand All @@ -47,18 +45,14 @@
"properties": {
"title": { "$ref": "#/$defs/title" },
"description": { "$ref": "#/$defs/description" },
"type": { "$ref": "#/$defs/propertyType" },
"$ref": { "$ref": "#/$defs/$ref" }
"type": { "$ref": "#/$defs/propertyType" }
},
"additionalProperties": false
"additionalProperties": false,
"required": ["type"]
},
"uriString": {
"type": "string",
"format": "uri"
},
"uriReferenceString": {
"type": "string",
"format": "uri-reference"
}
},
"additionalProperties": false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function validate($value, Constraint $constraint): void
private function getMetaSchemaLocalPath(string $id): ?string
{
return match ($id) {
'https://api.akeneo.com/mapping/product/0.0.1/schema' => __DIR__.'/../Symfony/Resources/schemas/product-0.0.1.json',
'https://api.akeneo.com/mapping/product/0.0.1/schema' => __DIR__.'/../Symfony/Resources/meta-schemas/product-0.0.1.json',
default => null,
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,6 @@ public function validSchemaDataProvider(): array
"title": "Description",
"description": "Product description in raw HTML",
"type": "string"
},
"url": { "$ref": "#/$defs/url" }
},
"$defs": {
"url": {
"title": "Url",
"type": "string"
}
}
}
Expand All @@ -100,6 +93,16 @@ public function invalidSchemaDataProvider(): array
}
}
}
JSON,
],
'0.0.1 with missing target type' => [
'schema' => <<<'JSON'
{
"$schema": "https://api.akeneo.com/mapping/product/0.0.1/schema",
"properties": {
"price": {}
}
}
JSON,
],
];
Expand Down

0 comments on commit dc99e15

Please sign in to comment.