quicktype icon indicating copy to clipboard operation
quicktype copied to clipboard

Generating dose not work or I do something wrong

Open LucaGabi opened this issue 6 years ago • 3 comments

Hi,

using this json schema:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "DatabaseSchema",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "DataTypes": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/definitions/DataType"
      }
    },
    "StoredProcedures": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/definitions/DatabaseStoredProcedure"
      }
    },
    "Packages": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/definitions/DatabasePackage"
      }
    },
    "Tables": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/definitions/DatabaseTable"
      }
    },
    "Views": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/definitions/DatabaseView"
      }
    },
    "Users": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/definitions/DatabaseUser"
      }
    },
    "Schemas": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/definitions/DatabaseDbSchema"
      }
    },
    "Functions": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/definitions/DatabaseFunction"
      }
    },
    "Sequences": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/definitions/DatabaseSequence"
      }
    },
    "Provider": {
      "type": [
        "null",
        "string"
      ]
    },
    "ConnectionString": {
      "type": [
        "null",
        "string"
      ]
    },
    "Owner": {
      "type": [
        "null",
        "string"
      ]
    }
  },
  "definitions": {
    "DataType": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "TypeName": {
          "type": [
            "null",
            "string"
          ]
        },
        "NetDataType": {
          "type": [
            "null",
            "string"
          ]
        },
        "NetDataTypeCSharpName": {
          "type": [
            "null",
            "string"
          ]
        },
        "IsString": {
          "type": "boolean"
        },
        "IsStringClob": {
          "type": "boolean"
        },
        "IsDateTime": {
          "type": "boolean"
        },
        "IsFloat": {
          "type": "boolean"
        },
        "IsInt": {
          "type": "boolean"
        },
        "IsNumeric": {
          "type": "boolean"
        },
        "ProviderDbType": {
          "type": "integer",
          "format": "int32"
        },
        "CreateFormat": {
          "type": [
            "null",
            "string"
          ]
        },
        "LiteralPrefix": {
          "type": [
            "null",
            "string"
          ]
        },
        "LiteralSuffix": {
          "type": [
            "null",
            "string"
          ]
        }
      }
    },
    "DatabaseStoredProcedure": {
      "allOf": [
        {
          "$ref": "#/definitions/NamedSchemaObjectOfDatabaseStoredProcedure"
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "FullName": {
              "type": [
                "null",
                "string"
              ]
            },
            "Package": {
              "type": [
                "null",
                "string"
              ]
            },
            "Sql": {
              "type": [
                "null",
                "string"
              ]
            },
            "Language": {
              "type": [
                "null",
                "string"
              ]
            },
            "Arguments": {
              "type": [
                "array",
                "null"
              ],
              "items": {
                "$ref": "#/definitions/DatabaseArgument"
              }
            },
            "ResultSets": {
              "type": [
                "array",
                "null"
              ],
              "items": {
                "$ref": "#/definitions/DatabaseResultSet"
              }
            },
            "DatabaseSchema": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#"
                }
              ]
            },
            "NetName": {
              "type": [
                "null",
                "string"
              ]
            }
          }
        }
      ]
    },
    "DatabaseArgument": {
      "allOf": [
        {
          "$ref": "#/definitions/NamedObjectOfDatabaseArgument"
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "SchemaOwner": {
              "type": [
                "null",
                "string"
              ]
            },
            "ProcedureName": {
              "type": [
                "null",
                "string"
              ]
            },
            "PackageName": {
              "type": [
                "null",
                "string"
              ]
            },
            "DatabaseDataType": {
              "type": [
                "null",
                "string"
              ]
            },
            "Ordinal": {
              "type": "number",
              "format": "decimal"
            },
            "Precision": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32"
            },
            "Scale": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32"
            },
            "Length": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32"
            },
            "In": {
              "type": "boolean"
            },
            "Out": {
              "type": "boolean"
            },
            "DataType": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/definitions/DataType"
                }
              ]
            },
            "NetName": {
              "type": [
                "null",
                "string"
              ]
            }
          }
        }
      ]
    },
    "NamedObjectOfDatabaseArgument": {
      "type": "object",
      "x-abstract": true,
      "additionalProperties": false,
      "properties": {
        "Name": {
          "type": [
            "null",
            "string"
          ]
        },
        "Tag": {
          "oneOf": [
            {},
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "DatabaseResultSet": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "Columns": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/definitions/DatabaseColumn"
          }
        },
        "NetName": {
          "type": [
            "null",
            "string"
          ]
        }
      }
    },
    "DatabaseColumn": {
      "allOf": [
        {
          "$ref": "#/definitions/NamedSchemaObjectOfDatabaseColumn"
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "DbDataType": {
              "type": [
                "null",
                "string"
              ]
            },
            "ForeignKeyTableName": {
              "type": [
                "null",
                "string"
              ]
            },
            "ForeignKeyTableNames": {
              "type": [
                "array",
                "null"
              ],
              "items": {
                "type": "string"
              }
            },
            "Length": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32"
            },
            "Nullable": {
              "type": "boolean"
            },
            "Ordinal": {
              "type": "integer",
              "format": "int32"
            },
            "DefaultValue": {
              "type": [
                "null",
                "string"
              ]
            },
            "Precision": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32"
            },
            "Scale": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32"
            },
            "DateTimePrecision": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32"
            },
            "TableName": {
              "type": [
                "null",
                "string"
              ]
            },
            "IdentityDefinition": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/definitions/DatabaseColumnIdentity"
                }
              ]
            },
            "ComputedDefinition": {
              "type": [
                "null",
                "string"
              ]
            },
            "Description": {
              "type": [
                "null",
                "string"
              ]
            },
            "IsForeignKey": {
              "type": "boolean"
            },
            "IsAutoNumber": {
              "type": "boolean"
            },
            "IsIndexed": {
              "type": "boolean"
            },
            "IsPrimaryKey": {
              "type": "boolean"
            },
            "IsUniqueKey": {
              "type": "boolean"
            },
            "NetName": {
              "type": [
                "null",
                "string"
              ]
            },
            "Table": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/definitions/DatabaseTable"
                }
              ]
            },
            "DatabaseSchema": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#"
                }
              ]
            },
            "DataType": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/definitions/DataType"
                }
              ]
            },
            "ForeignKeyTable": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/definitions/DatabaseTable"
                }
              ]
            },
            "IsComputed": {
              "type": "boolean"
            }
          }
        }
      ]
    },
    "DatabaseColumnIdentity": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "IdentitySeed": {
          "type": "integer",
          "format": "int64"
        },
        "IdentityIncrement": {
          "type": "integer",
          "format": "int64"
        },
        "IdentityByDefault": {
          "type": "boolean"
        }
      }
    },
    "DatabaseTable": {
      "allOf": [
        {
          "$ref": "#/definitions/NamedSchemaObjectOfDatabaseTable"
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "DatabaseSchema": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#"
                }
              ]
            },
            "NetName": {
              "type": [
                "null",
                "string"
              ]
            },
            "Description": {
              "type": [
                "null",
                "string"
              ]
            },
            "Columns": {
              "type": [
                "array",
                "null"
              ],
              "items": {
                "$ref": "#/definitions/DatabaseColumn"
              }
            },
            "PrimaryKeyColumn": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/definitions/DatabaseColumn"
                }
              ]
            },
            "PrimaryKey": {
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "$ref": "#/definitions/DatabaseConstraint"
                }
              ]
            },
            "ForeignKeys": {
              "type": [
                "array",
                "null"
              ],
              "items": {
                "$ref": "#/definitions/DatabaseConstraint"
              }
            },
            "UniqueKeys": {
              "type": [
                "array",
                "null"
              ],
              "items": {
                "$ref": "#/definitions/DatabaseConstraint"
              }
            },
            "CheckConstraints": {
              "type": [
                "array",
                "null"
              ],
              "items": {
                "$ref": "#/definitions/DatabaseConstraint"
              }
            },
            "DefaultConstraints": {
              "type": [
                "array",
                "null"
              ],
              "items": {
                "$ref": "#/definitions/DatabaseConstraint"
              }
            },
            "ForeignKeyChildren": {
              "type": [
                "array",
                "null"
              ],
              "items": {
                "$ref": "#/definitions/DatabaseTable"
              }
            },
            "Triggers": {
              "type": [
                "array",
                "null"
              ],
              "items": {
                "$ref": "#/definitions/DatabaseTrigger"
              }
            },
            "Indexes": {
              "type": [
                "array",
                "null"
              ],
              "items": {
                "$ref": "#/definitions/DatabaseIndex"
              }
            },
            "HasCompositeKey": {
              "type": "boolean"
            },
            "HasAutoNumberColumn": {
              "type": "boolean"
            }
          }
        }
      ]
    },
    "DatabaseConstraint": {
      "allOf": [
        {
          "$ref": "#/definitions/NamedSchemaObjectOfDatabaseConstraint"
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "TableName": {
              "type": [
                "null",
                "string"
              ]
            },
            "RefersToConstraint": {
              "type": [
                "null",
                "string"
              ]
            },
            "RefersToTable": {
              "type": [
                "null",
                "string"
              ]
            },
            "RefersToSchema": {
              "type": [
                "null",
                "string"
              ]
            },
            "DeleteRule": {
              "type": [
                "null",
                "string"
              ]
            },
            "UpdateRule": {
              "type": [
                "null",
                "string"
              ]
            },
            "ConstraintType": {
              "$ref": "#/definitions/ConstraintType"
            },
            "Columns": {
              "type": [
                "array",
                "null"
              ],
              "items": {
                "type": "string"
              }
            },
            "Expression": {
              "type": [
                "null",
                "string"
              ]
            }
          }
        }
      ]
    },
    "ConstraintType": {
      "type": "integer",
      "description": "",
      "x-enumNames": [
        "PrimaryKey",
        "ForeignKey",
        "UniqueKey",
        "Check",
        "Default"
      ],
      "enum": [
        0,
        1,
        2,
        3,
        4
      ]
    },
    "NamedSchemaObjectOfDatabaseConstraint": {
      "allOf": [
        {
          "$ref": "#/definitions/NamedObjectOfDatabaseConstraint"
        },
        {
          "type": "object",
          "x-abstract": true,
          "additionalProperties": false,
          "properties": {
            "SchemaOwner": {
              "type": [
                "null",
                "string"
              ]
            }
          }
        }
      ]
    },
    "NamedObjectOfDatabaseConstraint": {
      "type": "object",
      "x-abstract": true,
      "additionalProperties": false,
      "properties": {
        "Name": {
          "type": [
            "null",
            "string"
          ]
        },
        "Tag": {
          "oneOf": [
            {},
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "DatabaseTrigger": {
      "allOf": [
        {
          "$ref": "#/definitions/NamedSchemaObjectOfDatabaseTrigger"
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "TableName": {
              "type": [
                "null",
                "string"
              ]
            },
            "TriggerBody": {
              "type": [
                "null",
                "string"
              ]
            },
            "TriggerEvent": {
              "type": [
                "null",
                "string"
              ]
            },
            "TriggerType": {
              "type": [
                "null",
                "string"
              ]
            }
          }
        }
      ]
    },
    "NamedSchemaObjectOfDatabaseTrigger": {
      "allOf": [
        {
          "$ref": "#/definitions/NamedObjectOfDatabaseTrigger"
        },
        {
          "type": "object",
          "x-abstract": true,
          "additionalProperties": false,
          "properties": {
            "SchemaOwner": {
              "type": [
                "null",
                "string"
              ]
            }
          }
        }
      ]
    },
    "NamedObjectOfDatabaseTrigger": {
      "type": "object",
      "x-abstract": true,
      "additionalProperties": false,
      "properties": {
        "Name": {
          "type": [
            "null",
            "string"
          ]
        },
        "Tag": {
          "oneOf": [
            {},
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "DatabaseIndex": {
      "allOf": [
        {
          "$ref": "#/definitions/NamedSchemaObjectOfDatabaseIndex"
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "TableName": {
              "type": [
                "null",
                "string"
              ]
            },
            "IndexType": {
              "type": [
                "null",
                "string"
              ]
            },
            "IsUnique": {
              "type": "boolean"
            },
            "Columns": {
              "type": [
                "array",
                "null"
              ],
              "items": {
                "$ref": "#/definitions/DatabaseColumn"
              }
            }
          }
        }
      ]
    },
    "NamedSchemaObjectOfDatabaseIndex": {
      "allOf": [
        {
          "$ref": "#/definitions/NamedObjectOfDatabaseIndex"
        },
        {
          "type": "object",
          "x-abstract": true,
          "additionalProperties": false,
          "properties": {
            "SchemaOwner": {
              "type": [
                "null",
                "string"
              ]
            }
          }
        }
      ]
    },
    "NamedObjectOfDatabaseIndex": {
      "type": "object",
      "x-abstract": true,
      "additionalProperties": false,
      "properties": {
        "Name": {
          "type": [
            "null",
            "string"
          ]
        },
        "Tag": {
          "oneOf": [
            {},
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "NamedSchemaObjectOfDatabaseTable": {
      "allOf": [
        {
          "$ref": "#/definitions/NamedObjectOfDatabaseTable"
        },
        {
          "type": "object",
          "x-abstract": true,
          "additionalProperties": false,
          "properties": {
            "SchemaOwner": {
              "type": [
                "null",
                "string"
              ]
            }
          }
        }
      ]
    },
    "NamedObjectOfDatabaseTable": {
      "type": "object",
      "x-abstract": true,
      "additionalProperties": false,
      "properties": {
        "Name": {
          "type": [
            "null",
            "string"
          ]
        },
        "Tag": {
          "oneOf": [
            {},
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "NamedSchemaObjectOfDatabaseColumn": {
      "allOf": [
        {
          "$ref": "#/definitions/NamedObjectOfDatabaseColumn"
        },
        {
          "type": "object",
          "x-abstract": true,
          "additionalProperties": false,
          "properties": {
            "SchemaOwner": {
              "type": [
                "null",
                "string"
              ]
            }
          }
        }
      ]
    },
    "NamedObjectOfDatabaseColumn": {
      "type": "object",
      "x-abstract": true,
      "additionalProperties": false,
      "properties": {
        "Name": {
          "type": [
            "null",
            "string"
          ]
        },
        "Tag": {
          "oneOf": [
            {},
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "NamedSchemaObjectOfDatabaseStoredProcedure": {
      "allOf": [
        {
          "$ref": "#/definitions/NamedObjectOfDatabaseStoredProcedure"
        },
        {
          "type": "object",
          "x-abstract": true,
          "additionalProperties": false,
          "properties": {
            "SchemaOwner": {
              "type": [
                "null",
                "string"
              ]
            }
          }
        }
      ]
    },
    "NamedObjectOfDatabaseStoredProcedure": {
      "type": "object",
      "x-abstract": true,
      "additionalProperties": false,
      "properties": {
        "Name": {
          "type": [
            "null",
            "string"
          ]
        },
        "Tag": {
          "oneOf": [
            {},
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "DatabasePackage": {
      "allOf": [
        {
          "$ref": "#/definitions/NamedSchemaObjectOfDatabasePackage"
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "Definition": {
              "type": [
                "null",
                "string"
              ]
            },
            "Body": {
              "type": [
                "null",
                "string"
              ]
            },
            "StoredProcedures": {
              "type": [
                "array",
                "null"
              ],
              "items": {
                "$ref": "#/definitions/DatabaseStoredProcedure"
              }
            },
            "Functions": {
              "type": [
                "array",
                "null"
              ],
              "items": {
                "$ref": "#/definitions/DatabaseFunction"
              }
            },
            "NetName": {
              "type": [
                "null",
                "string"
              ]
            }
          }
        }
      ]
    },
    "DatabaseFunction": {
      "allOf": [
        {
          "$ref": "#/definitions/DatabaseStoredProcedure"
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "ReturnType": {
              "type": [
                "null",
                "string"
              ]
            }
          }
        }
      ]
    },
    "NamedSchemaObjectOfDatabasePackage": {
      "allOf": [
        {
          "$ref": "#/definitions/NamedObjectOfDatabasePackage"
        },
        {
          "type": "object",
          "x-abstract": true,
          "additionalProperties": false,
          "properties": {
            "SchemaOwner": {
              "type": [
                "null",
                "string"
              ]
            }
          }
        }
      ]
    },
    "NamedObjectOfDatabasePackage": {
      "type": "object",
      "x-abstract": true,
      "additionalProperties": false,
      "properties": {
        "Name": {
          "type": [
            "null",
            "string"
          ]
        },
        "Tag": {
          "oneOf": [
            {},
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "DatabaseView": {
      "allOf": [
        {
          "$ref": "#/definitions/DatabaseTable"
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "Sql": {
              "type": [
                "null",
                "string"
              ]
            }
          }
        }
      ]
    },
    "DatabaseUser": {
      "allOf": [
        {
          "$ref": "#/definitions/NamedObjectOfDatabaseUser"
        },
        {
          "type": "object",
          "additionalProperties": false
        }
      ]
    },
    "NamedObjectOfDatabaseUser": {
      "type": "object",
      "x-abstract": true,
      "additionalProperties": false,
      "properties": {
        "Name": {
          "type": [
            "null",
            "string"
          ]
        },
        "Tag": {
          "oneOf": [
            {},
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "DatabaseDbSchema": {
      "allOf": [
        {
          "$ref": "#/definitions/NamedObjectOfDatabaseDbSchema"
        },
        {
          "type": "object",
          "additionalProperties": false
        }
      ]
    },
    "NamedObjectOfDatabaseDbSchema": {
      "type": "object",
      "x-abstract": true,
      "additionalProperties": false,
      "properties": {
        "Name": {
          "type": [
            "null",
            "string"
          ]
        },
        "Tag": {
          "oneOf": [
            {},
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "DatabaseSequence": {
      "allOf": [
        {
          "$ref": "#/definitions/NamedSchemaObjectOfDatabaseSequence"
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "MinimumValue": {
              "type": [
                "null",
                "number"
              ],
              "format": "decimal"
            },
            "MaximumValue": {
              "type": [
                "null",
                "number"
              ],
              "format": "decimal"
            },
            "IncrementBy": {
              "type": "integer",
              "format": "int32"
            }
          }
        }
      ]
    },
    "NamedSchemaObjectOfDatabaseSequence": {
      "allOf": [
        {
          "$ref": "#/definitions/NamedObjectOfDatabaseSequence"
        },
        {
          "type": "object",
          "x-abstract": true,
          "additionalProperties": false,
          "properties": {
            "SchemaOwner": {
              "type": [
                "null",
                "string"
              ]
            }
          }
        }
      ]
    },
    "NamedObjectOfDatabaseSequence": {
      "type": "object",
      "x-abstract": true,
      "additionalProperties": false,
      "properties": {
        "Name": {
          "type": [
            "null",
            "string"
          ]
        },
        "Tag": {
          "oneOf": [
            {},
            {
              "type": "null"
            }
          ]
        }
      }
    }
  }
}

dose not generate code for all provided types

Thanks.

LucaGabi avatar Jan 16 '19 10:01 LucaGabi