Skip to content
This repository has been archived by the owner on Aug 13, 2024. It is now read-only.

Support patternProperties? #121

Closed
jbrok opened this issue Dec 16, 2015 · 2 comments
Closed

Support patternProperties? #121

jbrok opened this issue Dec 16, 2015 · 2 comments
Assignees
Labels

Comments

@jbrok
Copy link

jbrok commented Dec 16, 2015

Using Schema Guru DDL on a JSON Schema that uses patternProperties in 0.4.0 to create json path files and the .sql fails. The files are created but without my custom data fields from my properties. The JSON schema is created with Schema Guru (and then manually edited patternProperties). Schema DDL throws no error.

The documentation says this is supported:
"Object without properties, but with patternProperties becomes VARCHAR(4096)"

JSON Schema

...
  "type" : "object",
  "patternProperties" : {
    "^results(List)?$" : {
      "type" : "object",
      "properties" : {
        "subLocations" : {
...

Command
$ ./schema-guru-0.4.0 ddl --with-json-paths ./schemas/

Result
Missing data.fields.

-- AUTO-GENERATED BY schema-ddl DO NOT EDIT
-- Generator: schema-ddl 0.2.0
-- Generated: 2015-12-16 17:30

CREATE SCHEMA IF NOT EXISTS atomic;

CREATE TABLE IF NOT EXISTS atomic.com_treatwell_results_list_1 (
    "schema_vendor"  VARCHAR(128)  ENCODE RUNLENGTH NOT NULL,
    "schema_name"    VARCHAR(128)  ENCODE RUNLENGTH NOT NULL,
    "schema_format"  VARCHAR(128)  ENCODE RUNLENGTH NOT NULL,
    "schema_version" VARCHAR(128)  ENCODE RUNLENGTH NOT NULL,
    "root_id"        CHAR(36)      ENCODE RAW       NOT NULL,
    "root_tstamp"    TIMESTAMP     ENCODE LZO       NOT NULL,
    "ref_root"       VARCHAR(255)  ENCODE RUNLENGTH NOT NULL,
    "ref_tree"       VARCHAR(1500) ENCODE RUNLENGTH NOT NULL,
    "ref_parent"     VARCHAR(255)  ENCODE RUNLENGTH NOT NULL,
    FOREIGN KEY (root_id) REFERENCES atomic.events(event_id)
)

When I change patternProperties back to properties in the JSON and regenerate the files, it's working as expected..

@chuwy chuwy added the bug label Dec 16, 2015
@chuwy chuwy self-assigned this Dec 16, 2015
@chuwy chuwy added this to the Version 0.5.0 milestone Dec 16, 2015
@chuwy
Copy link
Contributor

chuwy commented Dec 16, 2015

Thanks @jbrok. Seems like a bug. I'll investigate it.

@chuwy
Copy link
Contributor

chuwy commented Mar 15, 2017

Migrated to snowplow/iglu#245

@chuwy chuwy closed this as completed Mar 15, 2017
@chuwy chuwy modified the milestone: Version 0.7.0 Mar 15, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants