Commit 4c5d108f authored by ozzeh's avatar ozzeh
Browse files

Add better way of dealing with empty arrays

parent 0a30e3fa
[tool.poetry]
name = "schema-registry"
version = "0.1.1"
version = "0.1.2"
description = ""
authors = ["ozzeh <ozzeh@pleaseignore.com>"]
......
from typing import Optional, List
from typing import Optional, List, Any
from datetime import datetime
from pydantic import BaseModel, create_model, Field, PrivateAttr
......@@ -54,7 +54,10 @@ class SchemaReflector:
)
def _resolve_array(self, property_info, required) -> tuple:
items = property_info.get("items")
items = property_info.get("items", {})
if not items:
return (Any, ... if required else None)
item_type, item_value = next(iter(items.items()))
if item_type == "$ref":
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment