Skip to content

Commit

Permalink
Add optinal to layer attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Kuethe committed Jul 21, 2024
1 parent e4486b8 commit 94eb3ba
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions maplibre/layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,16 @@ class Layer(BaseModel):
>>> layer = Layer(id="test-layer", type=LayerType.CIRCLE, source="test-source")
"""

id: str = Field(default_factory=lambda: str(uuid4()))
id: Optional[str] = Field(default_factory=lambda: str(uuid4()))
type: LayerType
filter: list = None
layout: dict = None
max_zoom: int = Field(None, serialization_alias="maxzoom")
metadata: dict = None
min_zoom: int = Field(None, serialization_alias="minzoom")
paint: dict = None
filter: Optional[list] = None
layout: Optional[dict] = None
max_zoom: Optional[int] = Field(None, serialization_alias="maxzoom")
metadata: Optional[dict] = None
min_zoom: Optional[int] = Field(None, serialization_alias="minzoom")
paint: Optional[dict] = None
source: Union[str, Source, dict, None] = None
source_layer: str = Field(None, serialization_alias="source-layer")
source_layer: Optional[str] = Field(None, serialization_alias="source-layer")

@field_validator("source")
def validate_source(cls, v):
Expand Down

0 comments on commit 94eb3ba

Please sign in to comment.