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

Resource json-schema versioning #67

Open
andersoncardoso opened this issue Sep 30, 2016 · 0 comments
Open

Resource json-schema versioning #67

andersoncardoso opened this issue Sep 30, 2016 · 0 comments
Labels

Comments

@andersoncardoso
Copy link
Contributor

We need to versionate json-schemas, so we can handle updates without breaking existing data.
Some of the points to be taken in account:

  • use a semantic versioning for the schemas. The minor version updates does no imply a new schema file, but major updates should require separate schema.
  • the resource should provide a @version identifier (otherwise we consider it as the last available version)
  • a migration mapping should be provided, so we can handle search through different schemas:
ver 1.0.0
{
    "ctid": "xyz",
    "descr": "abc"
}

ver 1.1.0
{
    "ctid": "xyz",
    "descrElements": {
        "descr": "abc",
        "shortDescr": "a"
    }   
}

Locator "dispatch" for query:
  v 1.0.0: "descr" => /descr
  v 1.1.0: "descr" => /descrElements/descr

So if someone searches for descr, there could be sql like:

where 
-- descr seach "dispatch"
(
    (schema_version = "1.0.0" and "/descr" = "abc")
    OR
    (schema_version = "1.1.0" and "/descrElements/descr" = "abc)
)

So for any searchable field, each schema version must maintain a "dispatch" locator for each searchable field. In this way, each schema is "responsible" for it's own query elements, and future schema don't need to know anything about that responsibility..
  • for a jsonb 'contains' query we should find the current 'path' query, and create a list of different versions for the same 'path', ORing them together as describe above
  • the JsonSchema class should handle this transparently.
@andersoncardoso andersoncardoso changed the title resource schema versioning Resource json-schema versioning Sep 30, 2016
@trinya trinya added the CER label Oct 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants