Skip to content

Commit

Permalink
Fix formatting and unused import
Browse files Browse the repository at this point in the history
  • Loading branch information
christiansandberg committed Nov 21, 2024
1 parent b893f19 commit f67aeb4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions onedm/sdf/from_type.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Conversion from native types to sdfData."""

from typing import Any, Type
from typing import Type

from pydantic import TypeAdapter
from pydantic.json_schema import GenerateJsonSchema
Expand Down Expand Up @@ -62,7 +62,8 @@ def enum_schema(self, schema: core_schema.EnumSchema):
def union_schema(self, schema: core_schema.UnionSchema):
definition = super().union_schema(schema)
definition["sdfChoice"] = {
f"choice-{i}": choice for i, choice in enumerate(definition["anyOf"], start=1)
f"choice-{i}": choice
for i, choice in enumerate(definition["anyOf"], start=1)
}
del definition["anyOf"]
return definition
Expand Down

0 comments on commit f67aeb4

Please sign in to comment.