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

Validate Docserv INI structure #306

Open
tomschr opened this issue Sep 1, 2024 · 0 comments
Open

Validate Docserv INI structure #306

tomschr opened this issue Sep 1, 2024 · 0 comments
Labels
enhancement New feature or request P2: soon Pretty important

Comments

@tomschr
Copy link
Contributor

tomschr commented Sep 1, 2024

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
@tomschr tomschr added enhancement New feature or request P2: soon Pretty important labels Sep 1, 2024
@tomschr tomschr changed the title Validate structure Validate Docserv INI structure Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request P2: soon Pretty important
Projects
None yet
Development

No branches or pull requests

1 participant