amper
Amper
Amper (Api MaPpER) is a CLI that generates files for building an API wrapper, based on a sample JSON file.
Currently only the Crystal programming language is supported, but in the future, other languages will likely be added.
Greatly inspired by Z64's api_mapper.
Any null values within the sample JSON file will cause AMPER to exit with an error, as it will be unable to determine the type for that key.
Installation
TODO: Write installation instructions here
Usage
The most basic usage of amper the name of the object (in camcel case), and the location of the example JSON file, preceded by the -f flag.
$ amper Foo -f "test/files/foo.json"
This will generate a file called foo.cr within the src folder, based on the structure of the specified json file.
Other options include the -t flag to generate a test file, or a -s flag to generate a spec file.
Development
TODO:
- Add nested object processing.
- Refactor Crystal templates to a mixin.
- Add other languages.
- Add Dummy lib for E2E testing.
Contributing
- Fork it (https://gitlab.com/HCLarsen/amper/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Chris Larsen - creator and maintainer
amper
- 0
- 0
- 0
- 0
- 2
- 5 days ago
- July 15, 2024
MIT License
Sun, 02 Nov 2025 15:21:43 GMT