i was not able to run openapicmd call with a param as indicated in docs, i found by downgrading to 1.12 i could get it to work, by comparing diff i noticed the request config was getting returned from different fx, not sure what all changed but this small tweak lets the cli work as documented
i was not able to run openapicmd call with a param as indicated in docs, i found by downgrading to 1.12 i could get it to work, by comparing diff i noticed the request config was getting returned from different fx, not sure what all changed but this small tweak lets the cli work as documented
https://github.com/openapistack/openapicmd/compare/1.12.0...1.13.0
1.13.0
API=https://petstore3.swagger.io/api/v3/openapi.json ; npx -y openapicmd@1.13.0 call $API -i -o findPetsByStatus -p status=sold
findPetsByStatus GET /pet/findByStatus RESPONSE META: { "code": 400, "status": "Bad Request", "headers": { "date": "Sun, 17 Dec 2023 04:27:48 GMT", "content-type": "application/json", "content-length": "30", "connection": "close", "access-control-allow-origin": "*", "access-control-allow-methods": "GET, POST, DELETE, PUT", "access-control-allow-headers": "Content-Type, api_key, Authorization", "access-control-expose-headers": "Content-Disposition", "server": "Jetty(9.4.9.v20180320)" } } RESPONSE BODY: "No status provided. Try again?"
1.12.0
» API=https://petstore3.swagger.io/api/v3/openapi.json ; npx -y openapicmd@1.12.0 call $API -i -o findPetsByStatus -p status=sold
findPetsByStatus GET https://petstore3.swagger.io/api/v3/pet/findByStatus?status=sold RESPONSE META: { "code": 200, "status": "OK", "headers": { "date": "Sun, 17 Dec 2023 04:27:53 GMT", "content-type": "application/json", "content-length": "1087", "connection": "close", "access-control-allow-origin": "*", "access-control-allow-methods": "GET, POST, DELETE, PUT", "access-control-allow-headers": "Content-Type, api_key, Authorization", "access-control-expose-headers": "Content-Disposition", "server": "Jetty(9.4.9.v20180320)" } } RESPONSE BODY: [ { "id": 5, "category": { "id": 1, "name": "Dogs" }, "name": "Dog 2", "photoUrls": [ "url1", "url2" ], "tags": [ { "id": 1, "name": "tag2" }, { "id": 2, "name": "tag3" } ], "status": "sold" }, { "id": 9223372016900036000, "category": { "id": 81261053, "name": "Bengal" }, "name": "Milo", "photoUrls": [ "https://example.com/image1.jpg" ], "tags": [ { "id": 308668, "name": "Chartreux" }, { "id": 14194199, "name": "Shiba Inu" } ], "status": "sold" }, { "id": 9223372016900081000, "category": { "id": 8784288, "name": "Saint Bernard" }, "name": "Milo", "photoUrls": [ "https://example.com/image1.jpg" ], "tags": [ { "id": 416352, "name": "Cocker Spaniel" }, { "id": 17203042, "name": "Shiba Inu" } ], "status": "sold" }, { "id": 9223372016900082000, "category": { "id": 3711228, "name": "Himalayan" }, "name": "Sadie", "photoUrls": [ "https://example.com/image1.jpg" ], "tags": [ { "id": 527127, "name": "Egyptian Mau" }, { "id": 21144561, "name": "Cocker Spaniel" } ], "status": "sold" }, { "id": 9223372016900041000, "category": { "id": 73470798, "name": "Savannah" }, "name": "Charlie", "photoUrls": [ "https://example.com/image1.jpg" ], "tags": [ { "id": 67873, "name": "French Bulldog" }, { "id": 4672546, "name": "Bichon Frise" } ], "status": "sold" } ]
localfix
npm run build ; API=https://petstore3.swagger.io/api/v3/openapi.json ; ./bin/run.js call $API -V -v -i -o findPetsByStatus -p status=sold
{ "method": "get", "url": "https://petstore3.swagger.io/api/v3/pet/findByStatus?status=sold", "path": "/pet/findByStatus", "pathParams": {}, "query": { "status": "sold" }, "queryString": "status=sold", "headers": { "Accept": "application/json, text/plain, /" }, "cookies": {} } findPetsByStatus GET https://petstore3.swagger.io/api/v3/pet/findByStatus?status=sold RESPONSE META: { "code": 200, "status": "OK", "headers": { "date": "Sun, 17 Dec 2023 04:40:31 GMT", "content-type": "application/json", "content-length": "1087", "connection": "close", "access-control-allow-origin": "*", "access-control-allow-methods": "GET, POST, DELETE, PUT", "access-control-allow-headers": "Content-Type, api_key, Authorization", "access-control-expose-headers": "Content-Disposition", "server": "Jetty(9.4.9.v20180320)" } } RESPONSE BODY: [ { "id": 5, "category": { "id": 1, "name": "Dogs" }, "name": "Dog 2", "photoUrls": [ "url1", "url2" ], "tags": [ { "id": 1, "name": "tag2" }, { "id": 2, "name": "tag3" } ], "status": "sold" }, { "id": 9223372016900036000, "category": { "id": 81261053, "name": "Bengal" }, "name": "Milo", "photoUrls": [ "https://example.com/image1.jpg" ], "tags": [ { "id": 308668, "name": "Chartreux" }, { "id": 14194199, "name": "Shiba Inu" } ], "status": "sold" }, { "id": 9223372016900081000, "category": { "id": 8784288, "name": "Saint Bernard" }, "name": "Milo", "photoUrls": [ "https://example.com/image1.jpg" ], "tags": [ { "id": 416352, "name": "Cocker Spaniel" }, { "id": 17203042, "name": "Shiba Inu" } ], "status": "sold" }, { "id": 9223372016900082000, "category": { "id": 3711228, "name": "Himalayan" }, "name": "Sadie", "photoUrls": [ "https://example.com/image1.jpg" ], "tags": [ { "id": 527127, "name": "Egyptian Mau" }, { "id": 21144561, "name": "Cocker Spaniel" } ], "status": "sold" }, { "id": 9223372016900041000, "category": { "id": 73470798, "name": "Savannah" }, "name": "Charlie", "photoUrls": [ "https://example.com/image1.jpg" ], "tags": [ { "id": 67873, "name": "French Bulldog" }, { "id": 4672546, "name": "Bichon Frise" } ], "status": "sold" } ]