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 simple_json_to_string() -> String

Format simple JSON response

pub fn status_to_json(code: Int) -> String

Format status code response as JSON string

pub fn text_to_string() -> String

Format plain text response

pub fn uuid_to_json() -> String

Format UUID response as JSON string

Search Document