From 22bb90a2b72d81bd4566c6471bd6936655c5c57e Mon Sep 17 00:00:00 2001 From: Jan Sandbrink Date: Thu, 30 Oct 2014 10:09:10 +0100 Subject: [PATCH] generalize rendering endpoints As long as OpenProject supports "plain" formatting we need to support it in the API too [ci skip] --- doc/apiv3-documentation.apib | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/doc/apiv3-documentation.apib b/doc/apiv3-documentation.apib index 2e40f7aadd..bfadd28fdd 100644 --- a/doc/apiv3-documentation.apib +++ b/doc/apiv3-documentation.apib @@ -430,12 +430,12 @@ Updates an activity's comment and, on success, returns the updated activity. # Group Previewing -Throughout OpenProject textile is used to support formatting of user input. -Using the apropriate rendering endpoint it is possible to render custom textile inputs into HTML and thus -receive a preview of the rendered textile. +Throughout OpenProject user input for many properties can be formatted (e.g. using *Textile*). +Using the apropriate rendering endpoint it is possible to render custom formatted inputs into HTML and thus +receive a preview of the rendered text. -The request to the endpoint should have a MIME-Type of `text/plain`. -The request body is the actual textile string that shall be rendered as HTML string. +The request to a rendering endpoint should always have a MIME-Type of `text/plain`. +The request body is the actual string that shall be rendered as HTML string. ## Textile [/render/textile{?context}] @@ -480,6 +480,23 @@ The request body is the actual textile string that shall be rendered as HTML str "message": "Could not render textile string in the given context." } +## Plain Text [/render/plain] + ++ Model + + Body + +

Hello world! This *is* plain text!

+ +## Preview plain document [POST] + ++ Request (text/plain) + + Hello world! This *is* plain text! + ++ Response 200 (text/html) + + [Plain Text][] + # Group Priorities ## Properties