1.0.1 • Published 2 years ago

@honoluluhenk/http-param-expander v1.0.1

Weekly downloads
-
License
LGPL-2.1-or-later
Repository
github
Last release
2 years ago

http-param-expander

Make your life easier with HTTP parameter encoding for typescript/javascript projects!

Contributors Forks Stargazers Issues MIT License

CI

About The Project

This Library aims to make your life easier with HTTP parameter encoding for typescript/javascript projects:

  • matrix parameters (mostly used by Java Jax-RS projects)
  • query parameters
  • form parameters
  • label parameters
  • simple parameters
  • and some more esoteric and custom parameter styles

Each in its exploded and flat form.

This is especially useful for REST-clients generated by OpenAPI generator where only a small subset of parameter styles is supported out of the box.

Getting Started

This npm library is intended to be used in typescript and javascript projects.

Just install the NPM package:

npm install @honoluluhenk/http-param-expander

Usage

import {MatrixParamExpander} from './matrix-param-expander'; 

const expander = new MatrixParamExpander();
const expanded = expander.expand({name: foo, value: {hello: 'world', bar: 'baz'}, exploded: true});
console.log(expanded);
// ;hello=world;bar=baz

Available expanders:

Changelog

See releases

Roadmap

  • Implement expander for deepObject style
  • Implement expander for spaceDelimited style
  • Implement expander for papeDelimited style

See the open issues for a full list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the Lesser Gnu Public License 2.1 (LGPL-2.1) License. See LICENSE for more information.

Contact

Christoph Linder - post@christoph-linder.ch

Project Link: https://github.com/HonoluluHenk/http-param-expander

Acknowledgments