I want to replace the value in sample json from larger swagger.json file content and it is too large.
Error:
/usr/bin/jq: Argument list too long error bash
worked to solve this issue for a few days and cannot identify the issue here. this is the sample json file:
{
"name": "",
"description": "",
"context": "",
"version": "",
"provider": "cbs",
"apiDefinition": "",
"wsdlUri": null,
"responseCaching": "Disabled",
"cacheTimeout": 300,
"destinationStatsEnabled": false,
"isDefaultVersion": true,
"transport": [
"http",
"https"
],
"tags": ["PROVIDER_","MIFE"],
"tiers": ["Unlimited","Default","Silver","Subscription","Gold","Premium","Bronze"],
"maxTps": {
"sandbox": 5000,
"production": 1000
},
"visibility": "PUBLIC",
"visibleRoles": [],
"endpointConfig": "",
"endpointSecurity": {
"username": "user",
"type": "basic",
"password": "pass"
},
"gatewayEnvironments": "Production and Sandbox",
"sequences": [],
"subscriptionAvailability": null,
"subscriptionAvailableTenants": [],
"businessInformation": {
"businessOwnerEmail": "BUSINESSOWNEREMAIL_",
"technicalOwnerEmail": "TECHNICALOWNEREMAIL_",
"technicalOwner": "TECHNICALOWNER_",
"businessOwner": "BUSINESSOWNER_"
},
"corsConfiguration": {
"accessControlAllowOrigins": ["*"],
"accessControlAllowHeaders": [
"authorization",
"Access-Control-Allow-Origin",
"Content-Type",
"SOAPAction"
],
"accessControlAllowMethods": [
"GET",
"PUT",
"POST",
"DELETE",
"PATCH",
"OPTIONS"
],
"accessControlAllowCredentials": false,
"corsConfigurationEnabled": false
}
}
- swagger.json file - Click here to download swagger.json file
this is the command i using and it give me a error which i as arguments too large.
swagger = $(cat swagger.json)
jq -r --arg swagger "$swagger" '.apiDefinition = $swagger' <<<"$json"
Can anyone please help!
swagger = $(cat swagger.json)
jqversion you are trying this on.