-
Goal: Be able to make PATCH/PUT/POST API calls that contain request body
-
Steps: Not sure about this one. In my case the issue occured after switching our API Platform from Swagger to Scalar
-
Details: The behaviour was observed on feature environment after switching API Platform from Swagger to Scalar. The same application with no modification manages to make PATCH, PUT and POST requests succesfully on environments that use the Swagger API Platform (eg. staging), yet the calls fail on the environment using the Scalar (feature).
The Retool queries are triggered with additionalScope property, that contains data to be sent as request body and the code is identical in both cases:
const promises = array
.filter((name) => !!name)
.map((name) => {
const commonPayload = {
name,
systems: multiselectSystems.value,
};
switch (selectAssetType.value) {
case "system":
return createSystem.trigger({
additionalScope: {
...commonPayload,
},
});
default:
}
});
return Promise.all(promises).then(() => {
// do stuff...
});
The API query configuration looks the same for both environments too:
The calls made with the use of Swagger API Platform are succesful and the request body is there and is correct:
But the behaviour is different when using the Scala API Platform. The request fail and it seems that the request body is not passed to the original request even though the data is visible in the Retool query call:
Really the only difference between both environments is the API Platform used, but the schemas in both are nearly identical. Any ideas what can cause the different behaviour?