• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ValeriyMenshikov / restcodegen / 19739786445

27 Nov 2025 02:37PM UTC coverage: 83.311% (-3.5%) from 86.838%
19739786445

Pull #9

github

web-flow
Merge 494573424 into 04717a691
Pull Request #9: Release/2.0.1

340 of 414 new or added lines in 10 files covered. (82.13%)

7 existing lines in 2 files now uncovered.

614 of 737 relevant lines covered (83.31%)

2.5 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

88.24
/restcodegen/generator/spec/normalizer.py
1
from __future__ import annotations
3✔
2

3
from typing import Any, Iterable, Protocol
3✔
4

5
from restcodegen.generator.spec.patchers import ComponentSchemaPatcher, InlineSchemaExtractor
3✔
6

7

8
class SpecTransform(Protocol):
3✔
9
    def patch(self, spec: dict[str, Any]) -> dict[str, Any]: ...
10

11

12
class SpecNormalizer:
3✔
13
    def __init__(self, transforms: Iterable[SpecTransform] | None = None) -> None:
3✔
14
        default_transforms = (InlineSchemaExtractor(), ComponentSchemaPatcher())
3✔
15
        self._transforms = list(transforms or default_transforms)
3✔
16

17
    def add_transform(self, transform: SpecTransform) -> None:
3✔
NEW
18
        self._transforms.append(transform)
×
19

20
    def normalize(self, spec: dict[str, Any]) -> dict[str, Any]:
3✔
21
        if not spec:
3✔
NEW
22
            return {}
×
23

24
        normalized = spec
3✔
25
        for transform in self._transforms:
3✔
26
            normalized = transform.patch(normalized)
3✔
27
        return normalized
3✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc