thecopy / apiary2postman Goto Github PK
View Code? Open in Web Editor NEWTool for generating a Postman collection from Blueprint API markup or the Apiary API
License: MIT License
Tool for generating a Postman collection from Blueprint API markup or the Apiary API
License: MIT License
Hi Erik, I help Postman with their developer community. We are thinking of reaching out to people who have created apps or tools related to Postman. I couldn't find your email on your site or here so thought I'd write GH issue. Hope you don't mind!
If you are interested to learn more, feel free to message me - priyanka @ getpostman.com
Thanks for the great tool. Just wanted to pass along a 403 error I'm getting:
$ apiary2postman api <api-key> <api-name>
Traceback (most recent call last):
File "/usr/local/bin/apiary2postman", line 9, in <module> load_entry_point('apiary2postman==0.4.1', 'console_scripts', 'apiary2postman')()
File "/Library/Python/2.7/site-packages/apiary2postman/apiary2postman.py", line 87, in main blueprint = fetch_blueprint(args.name[0], apikey)
File "/Library/Python/2.7/site-packages/apiary2postman/apiary.py", line 10, in fetch_blueprint response_body = json.loads(urlopen(request).read())
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 127, in urlopen return _opener.open(url, data, timeout)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 410, in open response = meth(req, response)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 523, in http_response 'http', request, response, code, msg, hdrs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 448, in error return self._call_chain(*args)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 382, in _call_chain result = func(*args)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 531, in http_error_default raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 403: Forbidden
Hi,
I tried exporting both directly from apiary using apiary2postman api my_api > my_api.dump
, and also converting the blueprint file using apiary2postman blueprint some.blueprint > postman.dump
.
In Apiary, I have /user/ endpoint with multiple calls under it (/user/refferal, /user/register/, etc.). When I import the final dump into Postman, all of the mentioned calls are in the folder based on endpoint (which is correct), but they all have the same url /user/
, not their whole respective urls as they should have.
I also checked the json generated by Drafter, and it contains the correct data (different url for each call), so it seems it is not correctly parsed by apiary2postman.
I have an API blueprint doc containing french text and it causes a bug in apiary2postman convertion :
Traceback (most recent call last):
File "/usr/local/bin/apiary2postman", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/site-packages/apiary2postman/apiary2postman.py", line 99, in main
input = blueprint2json(args.blueprint_input.read())
File "/usr/local/lib/python2.7/site-packages/apiary2postman/blueprint.py", line 15, in blueprint2json
out, err = p.communicate(blueprint.encode('utf8'))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 358: ordinal not in range(128)
Only on the standalone edition of Postman the responses always format to HTML instead of the response type. (JSON, XML). This is extremely annoying when working with many APIs.
The issues doesn't exist in the chrome web store version.
Hi, I believe it would be better to include prerequisites in the "installation section" - I've missed it at first and was having an error "no such file or directory" โ it actually took me some time to understand that there is nothing wrong with my file paths, and that the snowcrash was not installed.
Another suggestion: if snowcrash import fails it would be bice to raise an error, that explicitly says something like "Couldn't find snowcrash, please install it to use apiary2postman"
Though, that's a great tool, thank you!
keyword --only-collections exports only one method collection from api blueprint document (I have several collections, but the resulting .collection file only contains the first one)
I get a lot of errors from print 'Something'
print 'Please provide an api-key or set APIARY_API_KEY'
^
SyntaxError: Missing parentheses in call to 'print'
apiary2postman prints instructions:
By source:
git clone https://github.com/apiaryio/drafter
cd drafter
git checkout b3dce8d # This is the commit for release 0.1.9
./configure
make
sudo make install
This instructions are wrong. Drafter needs git clone --recursive (see https://github.com/apiaryio/drafter#build), otherwise the build fails with
/usr/bin/python: can't open file 'ext/snowcrash/tools/gyp/gyp_main.py': [Errno 2] No such file or directory
Hello,
any plans to wrap this tool by Docker? I can help if you want.
Thanks Peter
Hi,
When I create a postman file using apiary2postman to my blueprint file, where I used MSON to define any structure, the created postman doesn't contain any body data in the POST and PUT requests.
Is apiary2postman incompatible with MSON blueprint annotation?
This is my blueprint/MSON definition:
Request (application/hal+json)
Headers
Accept-Charset: utf-8
Body
Attributes (object)
And this is the generated postman for this request:
{
responses: [ ],
dataMode: "params",
tests: "",
description: "A new goal will be created using this action. This action takes a JSON payload as a part of the request. Response then return specific header and body + type (STRING) - Type of type of goal + title (string) - Title of the goal + description (string) - Description of the goal + creator (string) - Position id of the Goal creator + category (string) - Category of the created Goal ",
collectionId: "edeef016-6b25-487b-9269-1972535c0142",
url: "{{HOST}}/positions/132/periods/103/goals",
method: "POST",
headers: "Content-Type: application/hal+json Accept-Charset: utf-8 X-AUTH-TOKEN: {{token}} X-FORWARDED-HOST: local-133.umantis.lan Accept: application/hal+json;charset=UTF-8",
descriptionFormat: "html",
version: 2,
time: 1488549551,
synced: false,
pathVariables: { },
folder: "0d82c745-cfeb-4142-83a4-73009ac018a6",
data: [ ],
id: "ca288b97-cef6-497e-98de-520b4b09c273",
name: "Create a new goal"
},
.... where data is empty.
Hi,
Any chance to update to drafter ? Snowcrash cannot be installed anymore as CLI. It looks like just a replacement.
Hello,
This is related to the POSTMAN + web-service testing. I need the code which we can use to store the response of the request in the text file and then we can transfer that as an input to the next request.
Could anyone help me on this.
Thanks,
Atul S Parate
When I convert my API blueprint to a Postman collection and then run newman, I get a "Collection undefined" in the summary:
Through trial and error, I found that if I add an order
element in the top-level object inside collection.json
:
I get the folder listing that I would expect. The screenshot at the top is me running newman twice in a row and, before the second run, modifying collection.json
in another window to add the order
.
Any idea why the order
isn't getting made when I convert from blueprint?
Latest drafter JSON output seems to be incompatible with the tool. To workaround that we had to switch to an earlier version, e.g. v0.1.9
. This is the command:
brew install --HEAD https://raw.githubusercontent.com/apiaryio/drafter/b3dce8dda5d48b36e963abeffe5b0de7afecac3d/tools/homebrew/drafter.rb
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.