Skip to content

Conversation

simlal
Copy link

@simlal simlal commented Sep 24, 2025

Only tested the GEOMETRY('POINT') subtype using JsonSchema7Strategy() for a location: DataTypes.GEOMETRY('POINT') field.

Then using that schema with pydantic with datamodel-codegen got:

class Type(Enum):
    Point = 'Point'

class Location(BaseModel):
    type: Type
    coordinates: Annotated[List[float], Field(min_length=2)]


class Location(BaseModel):
    type: Type
    coordinates: Annotated[List[float], Field(min_length=2)]


class Addresses(BaseModel):
    id: int
    formatted_address: Optional[str] = None
    line1: Optional[str] = None
    ...
    location: Optional[Location] = None
    ...

@simlal
Copy link
Author

simlal commented Sep 24, 2025

Should add some tests but project does not seem maintained so lets see :)

@bravo-kernel
Copy link
Collaborator

Apologies but this library is indeed no longer maintained. I should have archived it. Bringing it back to modern days will be a pain.

@simlal
Copy link
Author

simlal commented Sep 24, 2025

No prob! Still works for my use case and will just make a patch in + postinstall hook then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants