ihp icon indicating copy to clipboard operation
ihp copied to clipboard

Allow defining rest API endpoints (with Swagger/OpenAPI)

Open philer opened this issue 2 years ago • 1 comments

Being able to define simple GET/PUT/POST/PATCH/DELETE endpoints with JSON data is a common use case for a modern back end web framework – if not the most common. It surprised me to find that IHP has no official support for it at all. This limits its usability to cases where I know I'll only ever have a simple web front end and not, say, a native phone app. It makes it hard for me to commit to this framework as a Haskell beginner, not knowing if I'll be able to use it for one of my basic requirements.

Please consider adding built in support for rest API endpoints. As a second step, generating a Swagger/OpenAPI schema would be very useful for ease of development.

Notes:

  • The section on JSON responses in the documentation should be enough to cover GET endpoints if I understand it correctly.
  • This question (#506) refers to additional documentation.

philer avatar Jan 30 '23 22:01 philer

The good news it that there's support for this use case, it's just not well documented as the documentation so far focusses a lot on full stack applications. But I agree that we improved this.

mpscholten avatar Feb 03 '23 07:02 mpscholten