Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

add invalid type validation and test#40

Open
sofiapag wants to merge 2 commits intomaster from
add-type-check
Open

add invalid type validation and test #40
sofiapag wants to merge 2 commits intomaster from
add-type-check

Conversation

@sofiapag
Copy link

@sofiapag sofiapag commented Jun 16, 2022
edited
Loading

The following incorrectly formatted geojson source will result in an internal server error:

{"type": "MultiPoint", "geometry": [[134.519974,34.084171],[134.546188,34.081322],[134.546219,34.078766],[134.542374,34.081287]]}
{"type": "MultiPoint", "geometry": [[130.405380,33.571598],[130.383682,33.567059],[130.486740,33.652233],[130.455490,33.597004],[130.437195,33.601784],[130.447998,33.654606],[130.409592,33.606941]]}

This PR adds an else case to catch invalid types and raise a TypeError

Note: looks like the python 3.7 build is failing, but it was in previous commits as well. I wonder why...

Copy link

coveralls commented Jun 16, 2022
edited
Loading

Coverage Status

Coverage increased (+0.006%) to 99.225% when pulling dfd5fa3 on add-type-check into 97f05d1 on master.

Copy link

Choose a reason for hiding this comment

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

Minor comment: the text in this error doesn't seem strictly true - it looks like {"coordinates": ...} will be accepted by line 120, which isn't a "Feature" or a "FeatureCollection".

sofiapag reacted with thumbs up emoji
Copy link
Author

Choose a reason for hiding this comment

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

Updated to something more generic, "Invalid type" dfd5fa3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@danpat danpat danpat left review comments

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Comments

AltStyle によって変換されたページ (->オリジナル) /