kielabokkie / blueman Goto Github PK
View Code? Open in Web Editor NEWConvert a generated API Blueprint JSON file into a Postman collection
License: MIT License
Convert a generated API Blueprint JSON file into a Postman collection
License: MIT License
I don't know if this is intentional or not, but as the Blueprints are resource-oriented, it might be better to have a folder for each resource, named after it.
And thus the collection can't be imported in Postman. Adding the collectionId manually fixes the Issue.
This happens ONLY to the first request of the file. Re-converting the Blueprint doesn't fix the problem.
I can't show the .json / .md files I converted as they contain confidential data.
apiblueprint.org has an API, so maybe this library should provide optional way to use it instead of requiring drafter?
Here is an example of client:
I have generated my json file using protagonist. Version 1.2.0 which is the latest.
grunt.registerTask('generateJson', 'Generate js version of referral file.', function () {
var protagonist = require('protagonist');
var content = grunt.file.read('../../../../doc/public/referral-api.md');
var result = protagonist.parseSync(content);
console.log(result);
var json = JSON.stringify(result);
grunt.file.write('test/frontend/referral.json', json);
});
When i run the command to convert I get that exception.
blueman convert referral.json
Any ideas?
Hello,
For some of our endpoints we get those errors:
PHP Notice: Undefined variable: convertedUri in phar:///usr/local/bin/blueman/vendor/pixelfusion/blueman/src/Blueman/Console/Command/ConvertCommand.php on line 172
PHP Warning: Invalid argument supplied for foreach() in phar:///usr/local/bin/blueman/vendor/pixelfusion/blueman/src/Blueman/Console/Command/ConvertCommand.php on line 161
Do you have any clue why? In any case, your code should initialize the variable so the notice is avoided.
Hi,
I generated a json file from my api blueprint file using node module protagonist.
I then installed blueman using composer.
I ran the command, but I see some php notices:
PHP Notice: Trying to get property of non-object in C:\PHP\your-project-name\src\Blueman\Console\Command\ConvertCommand.php on line
198
This is a code snippet of my json generation using grunt and protagonist:
grunt.registerTask('blah', 'Generate js version of apiary file.', function () {
var protagonist = require('protagonist');
var content = grunt.file.read('./doc/track-api.md');
var result = protagonist.parseSync(content);
console.log(result.ast);
var json = JSON.stringify(result.ast);
grunt.file.write('test/frontend/apiary.json', json);
});
I then run the command
./bin/console convert apiary.json --path=/c/java-projects/track-ui/test/frontend/.
This generates a collection.json file. But when I import it in postman, I get an error:
Invalid collection file: Each request must have a collectionId field.
Any clues!?
Thanks,
Shane.
Is this repository still alive or it is dead?
This is a great tool, I'm wondering if there is a command line option to change the file output name though?
For example snowcrash itself uses
snowcrash --format json --output X.json input.md
which I can then use as the input for Blueman such as:
blueman convert X.json
however it seems to only save the file name in the current working directory where you run the blueman command, and only as "collection.json".
Although this is really a nice to have option only as it looks like I can do something like:
blueman convert X.json && mv collection.json /anywhere/anything.json
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.