GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Update types in parser to fix mypy issues · nitheesh-me/python@efa8751

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • danger_python/generator
    • parser.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎danger_python/generator/parser.py‎

Copy file name to clipboardExpand all lines: danger_python/generator/parser.py
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@
1313
)
1414

1515

16-
def parse_schema(schema: str) -> List[SchemaObject]:
16+
def parse_schema(schema: str) -> List[SchemaItem]:
1717
objects = json.loads(schema).get("definitions", {})
1818
return _parse_items(objects)
1919

2020

21-
def _parse_items(json: Dict[str, Any]) -> List[SchemaObject]:
21+
def _parse_items(json: Dict[str, Any]) -> List[SchemaItem]:
2222
keys = sorted(json.keys())
2323
return list(filter(None, (_parse_item(name, json[name]) for name in keys)))
2424

2525

26-
def _parse_item(name: str, json: Dict[str, Any]) -> Optional[SchemaItem]:
26+
def _parse_item(name: str, json: Dict[str, Any]) -> SchemaItem:
2727
parsers = (
2828
_parse_object,
2929
_parse_enum,
@@ -45,7 +45,7 @@ def _parse_object(name: str, json: Dict[str, Any]) -> Optional[SchemaObject]:
4545
return None
4646

4747

48-
def _parse_value(name: str, json: Dict[str, Any]) -> Optional[SchemaValue]:
48+
def _parse_value(name: str, json: Dict[str, Any]) -> SchemaValue:
4949
value_types = json.get("type", None)
5050
if value_types:
5151
value_types = value_types if isinstance(value_types, list) else [value_types]

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.