Coder Social home page Coder Social logo

Comments (5)

eugenk avatar eugenk commented on June 18, 2024

I like the idea of generating the models (non-frontend-specific things) directly from the JSON Schema in the backend and I have given https://github.com/thoughtbot/ember-json-schema a try, but it does not work out of the box with our JSON Schema definitions.

It does not use the attributes and relationships keys from the schema and only relies on the properties key, which is not defining a single property of the object (except for id and type which should be ignored anyway).

I think we should follow its idea to reduce work in the long run. Then, we would not need to duplicate our models in the frontend and the backend. We could fork the project and make it work with proper JSON Schema.

from ontohub-frontend.

eugenk avatar eugenk commented on June 18, 2024

With my fork at https://github.com/eugenk/ember-json-schema, this works. We need some conventions, though, concerning the JSON Schema files. They are be compiled in ontohub/ontohub-backend#71.

And we still need to resolve $ref in the JSON Schema.

from ontohub-frontend.

eugenk avatar eugenk commented on June 18, 2024

Instructions to try this:

  1. backend: git checkout 71-structure_json_schema_files
  2. backend: rails s
  3. frontend: git checkout 41-redo_mirage_config_from_from_scratch
  4. frontend: ln -s <ontohub-backend-repo>/spec/support/api/schemas app/schema (in the repository-root)
  5. frontend: ember s
  6. http://localhost:4200/ada/repo0

from ontohub-frontend.

eugenk avatar eugenk commented on June 18, 2024

I added a commit to the ember-plugin's repo that should resolve $refs, but it doesn't work because it tries to resolve them relative to the address (e.g. http://localhost:7357/2173/tests/other.json instead of the local path ./other). I don't have an idea of how to do this.

Edit: Before, I said that I added a commit to the frontend branch. This was wrong...

from ontohub-frontend.

phyrog avatar phyrog commented on June 18, 2024

Closed in #62.

from ontohub-frontend.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.