1
votes

scenario

We are evaluating breeze to adopt for our ionic mobile apps specifically for its offline caching capabilities. These apps will be consuming REST APIs powered by rails.

There currently exists functionality to generate json-schema from the ActiveRecord meta data through json_schema_builder and work is underway to dynamically expose a real-time schema definition. If anyone is keen to get involved please make your intentions known on the github issue since that is not the topic of this conversation.

breeze meta-data and json-schema

Overjoyed to find a page titled Meta Schema, impressed that breeze adopted json-schema to represent their meta-data. Equally disappointed to realize json-schema is only used to describe their own schema definition similar to the way meta schemas are used for describing json-schema itself.

json-schema 2 breeze meta-data

Lets not get into a debate on why we have json-schema defining yet another meta-data definition nor how valuable it would've been to have these efforts it took to accomplish this funneled into getting json-schema if it was found to be inadequate. Instead all I am searching to find is a way to turn existing json-schema into something breeze.js can understand. Google does not produce more on the topic, that I can find anyway, and the breeze project suggests we take it up here.

The documentation explains a way of loading meta-data from script by capturing the metadata from what I can only assume to be MC-CSDL Microsofts contribution to yet another standard defining the same.

Aside from doing it by hand and defeating the purpose of having these resources at our disposal, has anyone tried or know of ways to:

  • turn json-schema into breeze meta-data
  • perhaps any support for ActiveRecord reflections
  • at the very least something to query postgresql for the information

Feel free to correct me if you feel I am mistaken and I apologise in advance for any perceived audacities as it is not my intention to offend or annoy you. Please excuse me if I don't further entertain any complaints. I do however welcome any wisdom, insights and intellectual discourse on this topic and do very much appreciate your valuable time and input.

Thank you!

1

1 Answers

0
votes

I appreciate your dilemma. I keep looking at json-schema in hopes that Breeze could join it as a standard. It just doesn't carry the information Breeze needs to manage data on the client.

The json-schema does carry much of the schema data that a Breeze client needs. While it might be inadequate on its own, it should give you a head start in writing Breeze metadata by hand.

Some glorious day I imagine a scenario such as this:

  • A JavaScript breeze-metadata-builder module that can combine metadata information feeds from multiple sources

  • A JSON configuration file that identifies those sources

    • One source is a json-schema feed

    • Another source returns hand-written "customizations" that fill-in-the-blanks from a Breeze metadata perspective

  • The breeze-metadata-builder merges the two sources into a single, Breeze metadata-format feed.

  • Run this process in node as a Grunt task, outputting a json or JavaScript file

  • Client on launch imports this metadata into a MetadataStore

Who is going to write it and share it with the community? How about you @nicki? I'll happily lend a hand.