Skip to content

Commit

Permalink
Updating postman assets
Browse files Browse the repository at this point in the history
  • Loading branch information
bryancross committed Oct 8, 2023
1 parent 57ccb7e commit ec89ece
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 103 deletions.
99 changes: 0 additions & 99 deletions postman/ConvertOAS.postman_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -1523,105 +1523,6 @@
},
"response": []
},
{
"name": "ConvertOAS2To3 Copy",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"const json = pm.response.json();",
"//console.log(json.b64);",
"var oas30schema = \"\";",
"if(pm.environment.get('cfg_outputFileFormat') == 'yaml' || pm.environment.get('cfg_outputFileFormat') == 'yml')",
"{",
" oas30schema = Buffer.from(json.b64,'base64').toString('utf-8');",
"}",
"else {",
" oas30schema = JSON.stringify(json.spec);",
"}",
"",
"let oas30schemaString = \"\";",
"oas30schemaString = oas30schema.replaceAll(/\\n/g, \"\\\\n\");",
"oas30schemaString = oas30schema.replaceAll(/\\\"/g, \"\\\\\\\"\");",
"console.log(oas30schemaString);",
"pm.environment.set('rt_targetSchema', oas30schema);",
"pm.environment.set('rt_targetSchema-string',oas30schemaString)",
"",
"if(pm.environment.get('cfg_createNewAPI') == 'false') {",
" postman.setNextRequest(\"Add 3.0 Schema\")",
"}",
""
],
"type": "text/javascript"
}
},
{
"listen": "prerequest",
"script": {
"exec": [
"let sourceSchema = pm.environment.get('rt_sourceSchema');",
"//console.log(\"Source schema: \", sourceSchema);",
"let sourceSchema64 = Buffer.from(sourceSchema).toString('base64');",
"console.log(sourceSchema64);",
"pm.environment.set('rt_sourceSchema64',sourceSchema64);",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\"b64\":\"{{rt_sourceSchema64}}\"}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://eaa7painas5mlef3tqy6md4t3m0kgoto.lambda-url.us-east-2.on.aws/?outputFileFormat={{rt_sourceFileFormat}}&inputFileFormat={{rt_sourceFileFormat}}&inputAPIType=swagger_2&outputAPIType={{cfg_outputAPIType}}",
"protocol": "https",
"host": [
"eaa7painas5mlef3tqy6md4t3m0kgoto",
"lambda-url",
"us-east-2",
"on",
"aws"
],
"path": [
""
],
"query": [
{
"key": "outputFileFormat",
"value": "{{rt_sourceFileFormat}}"
},
{
"key": "inputFileFormat",
"value": "{{rt_sourceFileFormat}}"
},
{
"key": "inputAPIType",
"value": "swagger_2"
},
{
"key": "outputAPIType",
"value": "{{cfg_outputAPIType}}"
}
]
},
"description": "Sends the source OAS file to a Lambda function at `cfg_OASConverterUrl` for conversion:\n\n#### Parameters\n\n**outputAPIType**: The OAS version to convert the source to is specified in the `cfg_outputAPIType` variable. Currently only `openapi_3` is supported."
},
"response": []
},
{
"name": "Create 3.0 API",
"event": [
Expand Down
14 changes: 10 additions & 4 deletions postman/ConvertOAS.postman_environment.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "f4729082-c30a-4d98-b09e-be72a0a669ca",
"id": "8e8fc40e-9321-4adb-885b-8abe0753f8bd",
"name": "Convert OAS 2 to OAS 3",
"values": [
{
Expand All @@ -10,7 +10,7 @@
},
{
"key": "cfg_workspaceId",
"value": "b300ef5a-6cf8-4295-9712-0cfecc414f50",
"value": "",
"type": "default",
"enabled": true
},
Expand All @@ -28,7 +28,7 @@
},
{
"key": "cfg_outputFileFormat",
"value": "",
"value": "yaml",
"type": "default",
"enabled": true
},
Expand Down Expand Up @@ -127,9 +127,15 @@
"value": "",
"type": "any",
"enabled": true
},
{
"key": "cfg_APINameFilter",
"value": "",
"type": "default",
"enabled": true
}
],
"_postman_variable_scope": "environment",
"_postman_exported_at": "2023-10-08T00:06:01.156Z",
"_postman_exported_at": "2023-10-08T17:51:49.759Z",
"_postman_exported_using": "Postman/10.18.10-231005-0655"
}

0 comments on commit ec89ece

Please sign in to comment.