-
-
Notifications
You must be signed in to change notification settings - Fork 456
Introduction JSON extension #2365
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
base: master
Are you sure you want to change the base?
Conversation
|
Hello - Have you spoken with anyone prior to proposing this? Sounds like it's a good extension, but not one that's ubiquitous enough to be included with sourcemod |
Not yet. I'm suggesting that SourceMod should have a modern, official JSON extension, considering AMXX has long included this capability alliedmodders/amxmodx#379 |
|
The extension looks useful and well-designed. |
|
Throwing in my two cents. This looks nice, but much like headline said I think this should have been talked over before opening a PR. Historically when sourcemod takes in new extensions, the accepted extension is already well established into the plugin ecosystem. This has two benefits :
REST in Pawn has been mentioned, and it is indeed (at least to me) the go-to JSON extension for plugins. Accepting this extension instead would mean that the plugin authors who care about JSON capabilities will have to migrate to this API (and maybe uncover bugs in the process). I don't think it's a dealbreaker, but I'm mentioning why accepting could cause troubles. Last, and this is mostly a nitpick. I don't think it should ever be leaked to plugins what kind of json's flavor they're using. |
You're right - I should have discussed this with the community first. I got overly excited about the technical implementation and jumped into the PR stage too early.
|
Features
Basic Examples
Working with Objects
Working with Arrays
Advanced Features
Using JSON Pointer
Array and Object Iteration
Array Search Operations
Sorting Arrays and Objects
Using FromStrings
Using JSON Pack
Working with Immutable Documents
When parsing JSON documents, you can choose whether to create a mutable or immutable document:
Immutable documents:
Operations on Immutable Documents
Immutable documents support a variety of read operations:
Example of operations with immutable documents:
Converting Between Mutable and Immutable
You can convert between mutable and immutable documents using deep copy: