Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make GeoPolygon interiors optional #2766

Merged
merged 1 commit into from Oct 5, 2023
Merged

Conversation

agourlay
Copy link
Member

@agourlay agourlay commented Oct 5, 2023

In #2315 we made the interiors field of geo polygons effectively optional by performing the validation in a shadow type.

We have tests showing that it works fine but we forgot to propagate the change to the type which provided the JSON schema.

Issue discovered while updating the Python client qdrant/qdrant-client#325

@@ -1350,7 +1350,7 @@ pub struct GeoPolygon {
/// Interior lines (if present) bound holes within the surface
/// each GeoLineString must consist of a minimum of 4 points, and the first
/// and last points must be the same.
pub interiors: Vec<GeoLineString>,
pub interiors: Option<Vec<GeoLineString>>,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here is the important change.

Scrolling above you will find the shadow type which already had the optional field

#[derive(Deserialize)]
pub struct GeoPolygonShadow {
    pub exterior: GeoLineString,
    pub interiors: Option<Vec<GeoLineString>>,
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for capturing!

@agourlay agourlay merged commit 3bff12d into dev Oct 5, 2023
18 checks passed
@agourlay agourlay deleted the make-geopolygon-interior-optional branch October 5, 2023 16:34
generall pushed a commit that referenced this pull request Oct 6, 2023
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.

None yet

3 participants