You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 28, 2023. It is now read-only.
Checkout process > creating/submitting order via endpoint "/api/order"
Entry point: "src/api/order.ts"
Affacted files
"src/api/order.ts"
"src/platform/magento2/o2m.js"
Description
Expected behaviour
The received order json object should be validated according to the json schemas:
"src/models/order.schema.js"
"src/models/order.schema.extension.json" (optional)
Actual behaviour
The received order json object is not properly validated against the "order.schema.js" schema.
In fact, the validation always returns true, regardless of the properties composition and values the order json object contains.
Any additional rules in "order.schema.extension.json" are correctly triggered and can lead to a failed or successful validation result.
Reproduction steps
Send an empty json object to the endpoint "/api/order/" via POST request (.e.g. via POSTMAN or INSOMNIA)
It will not fail due to validation errors but rather further along in the code (see picture)
Possible resolutions
Change all occurrences of "require('../../models/order.schema.js')" to "require('../../models/order.schema.js').default"
or
Change the file name of "src/order.schema.js" to "src/order.schema.json" and remove "exports.default =" from line 1.
Impact of change
Most likely a breaking change and might cause widespread failure of the route endpoint, since user implementations never had to pay attention to their order json object structure.
Most likely the validation rules inside "order.schema" would have to be re-tested and possibly rewritten.
The text was updated successfully, but these errors were encountered:
Version
vue-storefront-api 1.12.3
Scope
Checkout process > creating/submitting order via endpoint "/api/order"
Entry point: "src/api/order.ts"
Affacted files
Description
Expected behaviour
The received order json object should be validated according to the json schemas:
"src/models/order.schema.js"
"src/models/order.schema.extension.json" (optional)
Actual behaviour
The received order json object is not properly validated against the "order.schema.js" schema.
In fact, the validation always returns true, regardless of the properties composition and values the order json object contains.
Any additional rules in "order.schema.extension.json" are correctly triggered and can lead to a failed or successful validation result.
Reproduction steps
Possible resolutions
or
Impact of change
The text was updated successfully, but these errors were encountered: