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
I had a few syntax errors in my Portman config file this week, which led to some errors that were a little tricky to track down. I'm not sure if it's realistic to improve the validation, but I'd thought I'd submit this as an idea.
Here's the first example. Note that in this configuration, I use the keyword '-overwriteRequestBody'. This is invalid array syntax as there should be a space between the hyphen and the directive:
version: 1.0# Define the tests to run tests:
integrationTests:
- name: badTest1operations:
- openApiOperationId: leadsAddopenApiResponse: '200'variations:
- name: badOverwriteRequestBodyoverwrites:
-overwriteRequestBody:
- key: foovalue: bartests:
contentTests:
- responseBodyTests:
- key: foovalue: bar
Here is the result if I run this:
npx @apideck/portman -l /tmp/crm.yml -c /tmp/bad-config1.yaml
=========================================================================================================================================================================
Local Path: /tmp/crm.yml
Portman Config: /tmp/bad-config1.yaml
Postman Config: postman-config.default.json
Environment: .env
Inject Tests: true
Run Newman: false
Newman Iteration Data: false
Upload to Postman: false
=========================================================================================================================================================================
⠋ Converting OpenApi to Postman Collection
✔ Conversion successful
/Users/xxx/node_modules/@apideck/portman/dist/application/TestSuite.js:226
settings.map(function (overwriteSetting) {
^
TypeError: settings.map is not a function
at TestSuite.injectOverwrites (/Users/xxx/node_modules/@apideck/portman/dist/application/TestSuite.js:226:22)
...
It took me a while to track this problem down. It would have been nice if the validator would have given me an error similar to this one (which is generated if I set the directive to "- overwriteRequestBody" with the proper space after the hyphen, but missing the semicolon at the end of the directive):
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I had a few syntax errors in my Portman config file this week, which led to some errors that were a little tricky to track down. I'm not sure if it's realistic to improve the validation, but I'd thought I'd submit this as an idea.
Here's the first example. Note that in this configuration, I use the keyword '-overwriteRequestBody'. This is invalid array syntax as there should be a space between the hyphen and the directive:
Here is the result if I run this:
It took me a while to track this problem down. It would have been nice if the validator would have given me an error similar to this one (which is generated if I set the directive to "- overwriteRequestBody" with the proper space after the hyphen, but missing the semicolon at the end of the directive):
Unzip the following in /tmp to reproduce:
invalid-array-syntax.zip
Beta Was this translation helpful? Give feedback.
All reactions