Skip to content

Templating error when Examples in schema #2

Description

@mysiki

Hello,

thanks for your job.

I find a bug, when we use a example field in JSON schema, the output is break.

JSON Schema :

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "id": "schemata/afs_global_configuration",
  "title": "AFS - autre",
  "description": "Configuration file than control Global AFS Setting",
  "type": "object",
  "additionalProperties": true,
  "properties": {
    "afs_configuration_version": {
      "type": "integer",
      "default": 2,
      "minimum": 1,
      "maximum": 2
    },
    "afs_global": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "name": {
          "type": "string",
          "description": "Your AFS friendly name",
          "examples": [
            {
              "afs_global": {
                "name": "My Best AFS"
              }
            }
          ],
          "required": true,
          "title": "AFS Name"
      }
   }
}

Result (code html generated) :

<h2 id="properties">Properties</h2>
<ul>
<li><strong><code>afs_configuration_version</code></strong> <em>(integer)</em>: Minimum: <code>1</code>. Maximum: <code>2</code>. Default: <code>2</code>.</li>
<li><strong><code>afs_global</code></strong> <em>(object)</em>: Cannot contain additional properties.</li>
<li>
<p><strong><code>name</code></strong> <em>(string)</em>: Your AFS friendly name.</p>
<p>Examples: </p>
<div class="highlight"><pre><span></span><code><span class="p">{</span>
    <span class="nt">&quot;afs_global&quot;</span><span class="p">:</span> <span class="p">{</span>
        <span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;My Best AFS&quot;</span>
    <span class="p">}</span>
<span class="p">}</span>
</code></pre></div>

  - <strong><code>code</code></strong> <em>(string)</em>
  - <strong><code>provider</code></strong> <em>(string)</em>
  - <strong><code>admin_mail</code></strong> <em>(string)</em>
  - <strong><code>public_domain</code></strong> <em>(string)</em>

The '-' car are not replaced by <li> balise.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions