Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: use json path to configure which elements I would like to import #247

Open
divite opened this issue Sep 1, 2022 · 2 comments

Comments

@divite
Copy link

divite commented Sep 1, 2022

Feature description

As a user I would like to be able to import data that I fetched from datahub using the graphql interface into another pimcore instance.

Usually the resulting json file would look something like this:

{
  "data": {
    "getProductListing": {
      "edges": [
        {
          "node": {
            "fullpath": "/products/product1",
            "shortName": "my fancy product",
            "manufacturer": {
              "fullpath": "/manufacturers/MagicMaker"
            }
          }
        },
	...
    ]
  }	
}

Like already possible for XML with the XPath configuration, I would like to be able to configure a json path $..node to strip down the document to the relevant nodes. In this example it would then look as follows and would comply to the expected input format:

[
  {
    "fullpath": "/products/product1",
    "shortName": "my fancy product",
    "manufacturer": {
      "fullpath": "/manufacturers/MagicMaker"
    }
  }
  ,...
  {
    "fullpath": "/products/blackShoes",
    "shortName": "pair of black shoes",
    "manufacturer": {
      "fullpath": "/manufacturers/shoemaker"
    }
  }
]

In addition this would allow to export rather complex data structures via datahub and define several data imports for different data types but using the same import json, dealing with the needed dependencies of the data objects. E.g specifying the json path for the manufacturer in the example above.

@mcop1 mcop1 self-assigned this Sep 5, 2022
@divite
Copy link
Author

divite commented Sep 7, 2022

While trying to get this working I stumbled upon another thing, trying to reduce the manufacturer array to a single attribute value of fullpath. Feel free to follow the discussion over here: pimcore/pimcore#13092

Copy link

Thanks a lot for reporting the issue. We did not consider the issue as "Pimcore:Priority", "Pimcore:ToDo" or "Pimcore:Backlog", so we're not going to work on that anytime soon. Please create a pull request to fix the issue if this is a bug report. We'll then review it as quickly as possible. If you're interested in contributing a feature, please contact us first here before creating a pull request. We'll then decide whether we'd accept it or not. Thanks for your understanding.

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

No branches or pull requests

2 participants