-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow writing product options via API
- Loading branch information
Showing
10 changed files
with
499 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
54 changes: 54 additions & 0 deletions
54
tests/Responses/Expected/product_option/create_response.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
"id": @integer@, | ||
"code": "MUG_SIZE", | ||
"position": 0, | ||
"translations": { | ||
"en_US": { | ||
"id": @integer@, | ||
"locale": "en_US", | ||
"name": "Mug size" | ||
}, | ||
"de_CH": { | ||
"id": @integer@, | ||
"locale": "de_CH", | ||
"name": "Bechergröße" | ||
} | ||
}, | ||
"values": [ | ||
{ | ||
"code": "MUG_SIZE_S", | ||
"translations": { | ||
"en_US": { | ||
"id": @integer@, | ||
"locale": "en_US", | ||
"value": "Small" | ||
}, | ||
"de_CH": { | ||
"id": @integer@, | ||
"locale": "de_CH", | ||
"value": "Klein" | ||
} | ||
} | ||
}, | ||
{ | ||
"code": "MUG_SIZE_L", | ||
"translations": { | ||
"de_CH": { | ||
"id": @integer@, | ||
"locale": "de_CH", | ||
"value": "Groß" | ||
}, | ||
"en_US": { | ||
"id": @integer@, | ||
"locale": "en_US", | ||
"value": "Large" | ||
} | ||
} | ||
} | ||
], | ||
"_links": { | ||
"self": { | ||
"href": "\/api\/v1\/products\/MUG_SIZE" | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
tests/Responses/Expected/product_option/create_validation_fail_response.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"code": 400, | ||
"message": "Validation Failed", | ||
"errors": { | ||
"errors": [ | ||
"Please add at least 2 option values." | ||
], | ||
"children": { | ||
"position": {}, | ||
"translations": {}, | ||
"values": {}, | ||
"code": { | ||
"errors": [ | ||
"Please enter option code." | ||
] | ||
} | ||
} | ||
} | ||
} |
This file contains 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
Oops, something went wrong.