openSUSE / docserv

A server for building and publishing documentation with DAPS
https://opensuse.github.io/docserv/
GNU General Public License v3.0
4 stars 3 forks source link

Validate Docserv INI structure #306

Open tomschr opened 2 months ago

tomschr commented 2 months ago

Problem

Docserv is orchestrated through a docserv.ini file which contains all the options for the server and its targets.

The file src/docserv/docserv.py contains the class DocservConfig with the method parse_config() method. It reads such INI file and transforms it into a Python dictionary, validates the structure, converts data types, replaces placeholders etc.

The problem with this method is, it's very long, complicated and hard to maintain.

Possible Solution

The code has to be replaced by something more elaborate. We should delegate this to a project that can validate this structure.

Possible projects to consider:

Comparison of Solutions

Project Doc Learning
jsonschema extensive and detailed Steeper (JSON Schema standard)
Cerberus Clear & straightforward Easy & intuitive
marshmallow Comprehensive, plenty of examples, FAQ, Guides Moderate
pydantic Excellent, lots of examples Easy to moderate
schema Sufficient Easy