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

added code to support array type Properties #34

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

sai-prajeet
Copy link
Collaborator

Added support for Array Types

"writable": true,
"schema": {
"@type": "Array",
"elementSchema": "string"
Copy link

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; }
Copy link

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",
Copy link

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.

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