Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CAT-1339] Fix authorization header in Postman collection #106

Merged
merged 1 commit into from
Aug 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions shell/publish-postman-collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,11 @@

def patch_collection(postman_collection: dict) -> None:
"""
Fix type of file in upload forms, while waiting for issue resolution:
https://github.com/postmanlabs/openapi-to-postman/issues/795
Patch authorization header to be in the form: Token token={{apiToken}}
"""
for folder in postman_collection['item']:
for endpoint in folder['item']:
if ('body' in endpoint['request'] and
'formdata' in endpoint['request']['body']):
for input_field in endpoint['request']['body']['formdata']:
if (input_field['key'] == 'file' and
input_field['type'] == 'text'):
input_field['type'] = 'file'
del input_field['value']
for api_key in postman_collection['auth']['apikey']:
if api_key['key'] == 'value':
api_key['value'] = 'Token token={{apiToken}}'


def nest_collection(postman_collection: dict) -> None:
Expand Down