Skip to content

Resolve "add type hints to api.v1.resources.allele.AlleleListResource"

Description

Pydantic model namespace created at api.schemas.pydantic.v1

  • General pydantic scaffolding: api.schemas.pydantic.v1.common
    • BaseModel for general use, ExtraOK for when additional parameters are added to the resulting object without validation
    • misc enums that are likely to be reused
  • Initial pydantic models for:
    • allele_assessments
    • allele_reports
    • alleles
    • annotations
    • common
    • genotypes
    • references
    • resources
    • samples
    • users
    • Validates successfully against AlleleDataLoader output
  • Resource response validation
    • Resource response models in api.schemas.pydantic.v1.resources
    • Resource objects only need a decorator with the new model: @validate_output(PydanticResourceModel)
  • Schema generation
    • pydantic2json.py - generates JSON Schema files from pydantic models
    • pydantic2ts.sh - generates TypeScript interfaces/types from pydantic models (via JSON Schemas)
  • Pipfile
    • Updated:
      • mypy
      • typing-extensions
      • coverage
    • Added:
      • types-pytz
      • types-pyyaml
  • Misc
    • Bugfix for #2102 (closed), found while creating initial models
    • Assorted formatting/clean up of shell scripts
    • Testing profile for devcontainer with deadline disabled

Related issues

Notes to review (code/docs/QA)

Tests

General

  • Tests have been added that prove my fix is effective or that my feature works
  • Related tests have been modified/removed

Hypothesis testing:

  • Soak testing has been done
  • Distribution between positive / negative cases has been checked

Database

  • Includes changes to database schema
  • Includes necessary database migrations

Configuration

  • Includes changes to configuration
  • Includes configuration migration instructions in documentation

Closes #2005 (closed), #2102 (closed)

Edited by Tor Solli-Nowlan

Merge request reports