GithubHelp home page GithubHelp logo

Comments (12)

germanbisurgi avatar germanbisurgi commented on May 25, 2024

Hi @victorlut. I need the complete schema to reproduce this. Specifically the part related too document.personas

from json-editor.

victorlut avatar victorlut commented on May 25, 2024

@germanbisurgi Thanks for your reply. I can't share it fully but here's Personas. Personas is correctly located inside document, and it works well unless I use select2.

"personas": {
          "type": "array",
          "title": "Personas",
          "format": "table",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "title": "Persona",
            "format": "table",
            "properties": {
              "image": {
                "type": "string",
                "format": "uri",
                "qt-uri-protocols": ["https"],
                "qt-uri-extensions": [".svg"],
                "title": "Image",
                "description": "Type Uri here",
                "links": [
                  {
                    "href": "{{self}}",
                    "mediaType": "image"
                  }
                ]
              },
              "text": {
                "type": "string",
                "title": "Text"
              }
            },
            "required": ["text", "image"]
          }
}

from json-editor.

germanbisurgi avatar germanbisurgi commented on May 25, 2024

Could you provide a similar schema that produces the same error so i can debug this? At first glance i would say that the problem lays the JSON path:

"watch": {
  "personas": "document.personas"
}

It could be necessary to change it depending on the structure of your schema

from json-editor.

victorlut avatar victorlut commented on May 25, 2024

Could you provide a similar schema that produces the same error so i can debug this? At first glance i would say that the problem lays the JSON path:

"watch": {
  "personas": "document.personas"
}

It could be necessary to change it depending on the structure of your schema

Sure. If you change select2 to table, you can see it's working. But only select2 format doesn't work.

{
  "$schema": "http://json-schema.org/draft-06/schema#",
  "$ref": "#/definitions/Document",
  "definitions": {
    "Document": {
      "type": "object",
      "id": "document",
      "additionalProperties": false,
      "properties": {
        "personas": {
          "type": "array",
          "title": "Personas",
          "format": "table",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "title": "Persona",
            "format": "table",
            "properties": {
              "image": {
                "type": "string",
                "format": "uri",
                "qt-uri-protocols": ["https"],
                "qt-uri-extensions": [".svg"],
                "title": "Image",
                "description": "Type Uri here",
                "links": [
                  {
                    "href": "{{self}}",
                    "mediaType": "image"
                  }
                ]
              },
              "text": {
                "type": "string",
                "title": "Text"
              }
            },
            "required": ["text", "image"]
          }
        },
        "journeys": {
          "type": "array",
          "title": "Journeys",
          "items": {
            "type": "object",
            "title": "Journey",
            "properties": {
              "persons": {
                "type": "array",
                "format": "select2",
                "uniqueItems": true,
                "description": "You can choose some of Personas list described above",
                "items": {
                  "type": "string",
                  "name": "person",
                  "title": "person",
                  "watch": {
                    "personas": "document.personas"
                  },
                  "enumSource": [
                    {
                      "source": "personas",
                      "title": "{{item.text}}",
                      "value": "{{item.text}}"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "title": "Document"
    }
  }
}

from json-editor.

germanbisurgi avatar germanbisurgi commented on May 25, 2024

Move "format": "select2" from persons to persons.items schema

from json-editor.

victorlut avatar victorlut commented on May 25, 2024

Move "format": "select2" from persons to persons.items schema

It's not working. Does it work on your side?

from json-editor.

germanbisurgi avatar germanbisurgi commented on May 25, 2024

yes -> example

from json-editor.

victorlut avatar victorlut commented on May 25, 2024

yes -> example

Sorry. It's not what it should show. The result will be the same even if you remove format property. select2 should look like tags. Like this one. update

from json-editor.

schmunk42 avatar schmunk42 commented on May 25, 2024

@victorlut It should look like this, right?

image

But the select2 does not read the "personas" from the first array.

from json-editor.

victorlut avatar victorlut commented on May 25, 2024

@victorlut It should look like this, right?

image

But the select2 does not read the "personas" from the first array.

Yes, exactly!

from json-editor.

simontaurus avatar simontaurus commented on May 25, 2024

I guess this duplicates #665 and #1484 ?

from json-editor.

victorlut avatar victorlut commented on May 25, 2024

Did anyone found the solution yet?

from json-editor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.