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

  1. Fork it (https://gitlab.com/HCLarsen/amper/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

Repository

amper

Owner
Statistic
  • 0
  • 0
  • 0
  • 0
  • 2
  • 5 days ago
  • July 15, 2024
License

MIT License

Links
Synced at

Sun, 02 Nov 2025 15:21:43 GMT

Languages