Forum Stats

  • 3,770,705 Users
  • 2,253,155 Discussions
  • 7,875,553 Comments

Discussions

Reverse Engineer a JSON

Christyxo
Christyxo Member Posts: 146 Silver Badge
edited Feb 18, 2020 8:32AM in Data Integrator

Hi all,

I am executing a RESTful Service call for data and downloading a JSON file in the ATF8 character set in ODI 12.2.1.3

I have created a new complex file dataserver with physical and logical schema for this file, and have used ODI's native format builder to generate the required XSD file for this JSON file.

In the dataserver settings, I have filled in the value for dtd with the path to the xsd file (using the native formatter done this anyway), I have filled in the path to point to the JSON file. The compat mode is V3, the translator type is JSON, the root element and schema were defined during the format builder as root and xsdschema.

I've created a new model folder using the new logical schema, and attempted to reverse engineer the file but when I run either the reverse engineer, or the selective reverse engineer, nothing gets built in the model.

Can anyone suggest something I'm missing?

Note that I have 3 different JSON files, each configured with their own dataserver, and I'm having the same issue in all 3 instances.

Tagged:
Christyxo

Best Answer

  • Christyxo
    Christyxo Member Posts: 146 Silver Badge
    edited Feb 18, 2020 7:30AM Accepted Answer

    I've solved this now.

    In my physical schema I had record the schema as the directory containing the json file rather than the schema within the XSD ( xsdschema ).

    Stupid error but it's working now!

Answers

  • InfoDoc
    InfoDoc Member Posts: 280 Blue Ribbon
    edited Feb 17, 2020 4:40PM

    a few thoughts...

    While setting up physical topology, did you run the "TEST" at the end of the schema builder wizard?

    see sample below. 

    pastedImage_1.png

    if not, you can simply click the "Edit" schema button and run the wizard again

    pastedImage_2.png

    so with this sample json,

    {"menu": {

      "id": "file",

      "value": "File",

      "popup": {

        "menuitem": [

          {"value": "New", "onclick": "CreateNewDoc()"},

          {"value": "Open", "onclick": "OpenDoc()"},

          {"value": "Close", "onclick": "CloseDoc()"}

        ]

      }

    }}

    For example, I ran this simple test

    (click the green arrow)

    pastedImage_5.png

    Notice the items on the right look correct and match the json text above.

    also did you look at the generated xsd schema text file?

    it is sometimes helpful to see it.

    also if you run things with "local" ensure you test that while on the odi server itself (to ensure the server can get to the folders, etc)

    also verify you get success doing a simple "Test Connection" on the physical topology:

    pastedImage_9.png

    ChristyxoChristyxo
  • Christyxo
    Christyxo Member Posts: 146 Silver Badge
    edited Feb 17, 2020 6:24PM

    I really appreciate the time that you put into this response!

    Unfortunately, yes I did run the test and I'm getting the same successful connection using both the local agent and the stand alone agent.

    I considered that permissions may be an issue, however the folder directory and the files are all owned by Oracle and I even gave the full permissions to these directories and files with no success.

    However, I used your example and carried out the same steps as the above (including the test connection that you demonstrated) and I have exactly the same issue as with my original 3 files; When I attempt to reverse engineer a model, I get nothing in the model.

  • Christyxo
    Christyxo Member Posts: 146 Silver Badge
    edited Feb 18, 2020 7:30AM Accepted Answer

    I've solved this now.

    In my physical schema I had record the schema as the directory containing the json file rather than the schema within the XSD ( xsdschema ).

    Stupid error but it's working now!