dream_mock_server/views/api_view
api_view.gleam - Presentation logic for API endpoints
Pure formatting functions: Request data → String No Result types, no Response types, no error handling.
Values
pub fn delete_to_json(path: String) -> String
Format DELETE request info as JSON string
pub fn error_to_json(message: String) -> String
Format error message as JSON string
pub fn get_to_json(path: String, query: String) -> String
Format GET request info as JSON string
pub fn post_to_json(path: String, body: String) -> String
Format POST request info as JSON string
pub fn put_to_json(path: String, body: String) -> String
Format PUT request info as JSON string
pub fn status_to_json(code: Int) -> String
Format status code response as JSON string