Open imranshaik012 opened 3 years ago
can you post the full error?
Below is the code for an api with using POST method
@app.route('/convert', methods=['POST']) def cli(format, ignore, postmanfile, outfile): try: postmanfile = ('./collection.json') converter = swagman.Converter(request.body.fileName) swagger_output = converter.convert(format) return jsonify({ 'data': swagger_output }) with open(outfile, 'w') as f: f.write(swagger_output) click.echo(click.style('Schema converted successfully!', fg='green')) f.close() except ValueError as e: return False if name == 'main': app.run(debug=True) cli()
I Run the Command
python run.py collection.json openapi.yaml
till here its working fine it has created openapi file which is empty
On sending request with postman in the body i am passing input as filename also i tried using string instead of file same error i am getting
It throws an error on console
@codeasashu @imranshaik012
I do still get the same " TypeError" python run.py MY.postman_collection.json swagger1.yaml
TypeError: 'pmrequest' object is not subscriptable
Traceback (most recent call last):
File "run.py", line 32, in
@Infosec-RKR Sorry but I've renamed this project to openman. It contains a lot of bugfixes and have better mocking capabilities.
https://github.com/codeasashu/openman
Can you try that and see if it fixes the issue?
getting error while running a project
File "run.py", line 36, in
cli()