scribe icon indicating copy to clipboard operation
scribe copied to clipboard

Example with html description of bodyParam

Open albertogaldames opened this issue 5 years ago • 7 comments

  • [x] I've read the documentation and I can't find details on how to achieve this.

Hello, I'm trying to set an example in a @bodyParam field description where I have put some html code. If I just put the "Example: ..." string it set the example correctly but it also remove all the filed description. Is this even possible? How can I achieve this behaviour.

Here is an example of the field with html code. Where do I have to put the "Example:" string?

     * @bodyParam answers.attitude integer required The value must be one of <strong>1</strong>, <strong>2</strong>, <strong>3</strong> or <strong>4</strong> </br>
     *  <p><strong>Q</strong>: ¿Qué rentabilidad negativa anual puedes soportar sin verte forzado a vender?</p>
     *  <ul>
     *      <li><strong>1</strong>: Hasta -3%</li>
     *      <li><strong>2</strong>: Hasta -7%</li>
     *      <li><strong>3</strong>: Hasta -14%</li>
     *      <li><strong>4</strong>: Hasta -20%</li>
     *  </ul>

albertogaldames avatar Jan 18 '21 09:01 albertogaldames

Does the HTML work? If the HTML description works, you should be able to put the "Example:" right after it.

shalvah avatar Jan 18 '21 11:01 shalvah

It does work without the "Example:". But it all disappear right after I put the "Example:". I've tried it in different ways

     * @bodyParam answers.attitude integer required The value must be one of <strong>1</strong>, <strong>2</strong>, <strong>3</strong> or <strong>4</strong> </br>
     *  <p><strong>Q</strong>: ¿Qué rentabilidad negativa anual puedes soportar sin verte forzado a vender?</p>
     *  <ul>
     *      <li><strong>1</strong>: Hasta -3%</li>
     *      <li><strong>2</strong>: Hasta -7%</li>
     *      <li><strong>3</strong>: Hasta -14%</li>
     *      <li><strong>4</strong>: Hasta -20%</li>
     *  </ul> Example: 1
     * @bodyParam answers.attitude integer required The value must be one of <strong>1</strong>, <strong>2</strong>, <strong>3</strong> or <strong>4</strong> </br>
     *  <p><strong>Q</strong>: ¿Qué rentabilidad negativa anual puedes soportar sin verte forzado a vender?</p>
     *  <ul>
     *      <li><strong>1</strong>: Hasta -3%</li>
     *      <li><strong>2</strong>: Hasta -7%</li>
     *      <li><strong>3</strong>: Hasta -14%</li>
     *      <li><strong>4</strong>: Hasta -20%</li>
     *  </ul>
     *  Example: 1

But non of them are working, they all remove the whole HTML part.

albertogaldames avatar Jan 18 '21 11:01 albertogaldames

Hmm... There might be a bug in the regex that matches them.

But I wouldn't advise using HTML in your field descriptions. It's verbose and brittle. Everything in your example can be done with Markdown.

shalvah avatar Jan 18 '21 11:01 shalvah

Ok, I've changed it to markdown but I still have the same problem. The example is set correctly but the description disappears.

     * @bodyParam answers.attitude integer required The value must be one of **1**, **2**, **3** or **4**
     *  **Q**: ¿Qué rentabilidad negativa anual puedes soportar sin verte forzado a vender?
     *      * **1**: Hasta -3%
     *      * **2**: Hasta -7%
     *      * **3**: Hasta -14%
     *      * **4**: Hasta -20%
     * Example: 1

albertogaldames avatar Jan 18 '21 12:01 albertogaldames

Hello, is there any update on this bug?

albertogaldames avatar Apr 12 '21 11:04 albertogaldames

Currently working on v3. It's on the roadmap.

shalvah avatar Apr 21 '21 15:04 shalvah

This should be fixed in v2.7.3. Turned out to be a small issue.😅

shalvah avatar May 25 '21 11:05 shalvah