osrsbox / osrsbox-db

A complete and up-to-date database of Old School Runescape (OSRS) items, monsters and prayers
https://www.osrsbox.com/projects/osrsbox-db/
GNU General Public License v3.0
224 stars 82 forks source link

Data: Schemas: Change from JSON schema to Cerberus #163

Closed osrsbox closed 4 years ago

osrsbox commented 4 years ago

With lots of development on the board, it has spurred some changes to aspects of the project. In order to progress, the next change is moving from JSON schema to Cerberus. They are pretty similar, but Cerberus plays nicely with Python Eve validation (the framework for the new API) and regular Python validation (when building the database). Furthermore, Python Eve and a full RESTful API will bypass the need for JSON schema use in the MongoDB insertion (will use the API for data insertion - while other, regular users will only have GET access).

This change will require a slight rewrite of the exiting schemas, and will tighten up some of the validation rules, and data types. The files to fix are:

In addition, the generate_cache_schemas.py will need to be updated to fix the automated generation of schemas for the cache definition data.

EDIT: At the same time, it might be prudent to add in the quest database schema (after being revised) for future development.