Skip to content

Enhance Agtype class with array and map handling methods#2

Merged
nikoraes merged 5 commits into
mainfrom
fix/agtype-array-parsing
May 14, 2026
Merged

Enhance Agtype class with array and map handling methods#2
nikoraes merged 5 commits into
mainfrom
fix/agtype-array-parsing

Conversation

@nikoraes
Copy link
Copy Markdown
Member

This pull request adds new utility methods and properties to the Agtype class in Agtype.cs, making it easier to inspect and work with agtype values. The main focus is on improving type-checking and providing convenient ways to extract arrays and maps from agtype data.

New agtype inspection and extraction utilities:

  • Added IsNull, IsArray, and IsMap properties to easily check if an agtype value is null, an array, or a plain JSON object (map), respectively.
  • Implemented the GetArray() method, which returns the elements of an agtype array as individual Agtype values, preserving type annotations for each element. Throws a FormatException if the value is not an array.
  • Implemented the GetMap() method, which deserializes the agtype map into a Dictionary<string, object?>. Throws a FormatException if the value is not a map.

@nikoraes nikoraes merged commit a13f579 into main May 14, 2026
10 checks passed
@nikoraes nikoraes deleted the fix/agtype-array-parsing branch May 14, 2026 06:42
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.

1 participant