-
Notifications
You must be signed in to change notification settings - Fork 16
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
added code to support array type Properties #34
base: main
Are you sure you want to change the base?
Conversation
"writable": true, | ||
"schema": { | ||
"@type": "Array", | ||
"elementSchema": "string" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you not including this schema in the model?
@@ -30,6 +30,8 @@ public Space() | |||
public float? SquareFootArea { get; set; } | |||
[JsonPropertyName("capabilities")] | |||
public IDictionary<string, bool>? Capabilities { get; set; } | |||
[JsonPropertyName("geometry")] | |||
public Array? Geometry { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to provide a unit test on how this property can be used including: deserialization, iterating, adding or removing elements, etc.
"name": "geometry", | ||
"writable": true, | ||
"schema": { | ||
"@type": "Array", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For GeoJSON Geometry purposes, we don't want 1 array property; Geometry should be its own model and have 4 sub-types: point, line, polygon, multi-polygon. Then the space model can have a relationship to the geometry object (that could happen to be a polygon or a multi-polygon.
The other alternative is to use the generic Array as you do here, but still has to be the type of the coordinates, not the geometry (geometry should have a type
property as well).
Whichever approach you use, it's important to see it in action in the unit tests before we can move forward.
Added support for Array Types