mulesoft-labs / api-console-builder

A module to build a minified and concatenated file for the API console
Other
3 stars 7 forks source link

Building standalone application from local RAML file without JSON #3

Closed jarrodek closed 7 years ago

jarrodek commented 7 years ago

When building the API console from a local RAML file it is now trying to download the RAML file from the build location. But there's no file to download.

Option 1: It should copy the file to the build location. In this case the CLI tool has to accept argument to copy dependency files as well but the user would need to provide them all when using the command.

Option 2: It should automatically set --use-json option to generate the api.json file. No need for copying any dependencies to the build folder. In this case the CLI tool should print the information that it will not use the RAML as a source but the generated JSON file.

I think option 2 is better from the UX perspective. It could be problematic to list all fragments of the RAML file and pass it to the command. I can imagine that it could exceed max number of characters on Windows. Upside is that the user could just replace the RAML file on server. Downside is that the console will use parser and enhancer to build the data structure.

Downside for option 2 is that the user can't just simply replace a RAML file in the build but on the other hand, this is why we have enhancer as a Node module so it can be use in the CI to generate api.json file upload it to the server.

jarrodek commented 7 years ago

The builder will assume --use-json when building the console from local RAML.