https://github.com/reactivecore/fhttp
Functional HTTP Api Description in Scala
https://github.com/reactivecore/fhttp
Last synced: 5 months ago
JSON representation
Functional HTTP Api Description in Scala
- Host: GitHub
- URL: https://github.com/reactivecore/fhttp
- Owner: reactivecore
- License: apache-2.0
- Created: 2019-08-08T13:39:43.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2021-04-23T13:21:01.000Z (about 5 years ago)
- Last Synced: 2023-09-11T01:00:59.800Z (almost 3 years ago)
- Language: Scala
- Homepage:
- Size: 103 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
fhttp, functional Http-Api definition in Scala
==============================================
`fhttp` is a little proof of concept, whether it's possible to define a HTTP-API in a functional manner
without binding directly to a framework.
From the definition it should be possible to generate Server and Client implementations without that much boilerplate.
The definition should not have any dependencies to the Server/Client library.
Current State
-------------
This is a proof of concept. Although it works, expect bugs everywhere. There are no published packages.
How it works
------------
Each `ApiCall` instance is made of various transitions, stored in a full typed shapeless `HList`.
The Framework Implementation (at the moment only Akka HTTP)
lifts this list into an Encoder / Decoder for HTTP-Requests and their response.
Parts
-----
- `core` Definition system
- `akka` Implementation for Akka HTTP
- `example` A simple Example
Features
--------
- Support for path adding/extracting
- Support for Circe JSON, Strings
- Support for async file upload and download
- Support Query Parameters.
- Elegant transport for errors in error responses.
TODO
----
- Testing
- Better error handling
- Better path handling
- More HTTP Methods (right now only `GET`, `POST` and `DELETE`)
- Support for optional values
- Improved conversion routines (e.g. Boolean query parameters)
- Get rid of `VTree` if possible.
- Reduce number of `Future` mappings if possible.
- Extending
- Multi part decoding on Akka Server side buffers the request in Memory.