Skip to content

Commit

Permalink
Bootstrapped reference generator
Browse files Browse the repository at this point in the history
  • Loading branch information
roll committed Sep 7, 2023
1 parent 882114c commit 36c2885
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 16 deletions.
3 changes: 3 additions & 0 deletions docs/reference/schema.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Schema

::: dpspecs.Schema
27 changes: 16 additions & 11 deletions dpspecs/models/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@
from .base import Model


class Schema(Model):
"""Schema model"""

name: Optional[str] = None
type: Optional[str] = None
title: Optional[str] = None
description: Optional[str] = None

fields: List[Field]
"""List of fields"""

missingValues: Optional[List[str]] = None
primaryKey: Optional[List[str]] = None
foreignKeys: Optional[List[ForeignKey]] = None


class Field(Model):
name: str
type: str
Expand Down Expand Up @@ -91,14 +107,3 @@ class ForeignKeyReference(Model):
class ForeignKey(Model):
fields: List[str]
reference: Optional[ForeignKeyReference] = None


class Schema(Model):
name: Optional[str] = None
type: Optional[str] = None
title: Optional[str] = None
description: Optional[str] = None
fields: List[Field]
missingValues: Optional[List[str]] = None
primaryKey: Optional[List[str]] = None
foreignKeys: Optional[List[ForeignKey]] = None
9 changes: 4 additions & 5 deletions mkdocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,8 @@ theme:

# Plugins

# TODO: enable when it's released to general public
# https://squidfunk.github.io/mkdocs-material/insiders/#12000-piri-piri
# plugins:
# - blog:
# post_date_format: full
plugins:
- mkdocstrings

# Extras

Expand Down Expand Up @@ -111,5 +108,7 @@ nav:
- Documentation:
Installation: documentation/installation.md
Usage: documentation/usage.md
- Reference:
Schema: reference/schema.md
- Contributing:
Development: contributing/development.md
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ dev = [
"pytest-dotenv",
"pytest-timeout",
"pytest-lazy-fixture",
"mkdocstrings[python]",
"mkdocs-material",
]

Expand Down
Empty file added tests/models/__init__.py
Empty file.
Empty file added tests/models/test_schema.py
Empty file.

0 comments on commit 36c2885

Please sign in to comment.