Skip to content

Add json_count_keys usage example#763

Open
RUNQILIU-123 wants to merge 1 commit into
thoth-tech:usage-examplesfrom
RUNQILIU-123:json-count-keys-clean
Open

Add json_count_keys usage example#763
RUNQILIU-123 wants to merge 1 commit into
thoth-tech:usage-examplesfrom
RUNQILIU-123:json-count-keys-clean

Conversation

@RUNQILIU-123
Copy link
Copy Markdown

Summary

This pull request adds an initial usage example for json_count_keys in the json category.

Files added

  • json_count_keys-1-example.cpp
  • json_count_keys-1-example.py
  • json_count_keys-1-example-top-level.cs
  • json_count_keys-1-example-oop.cs
  • json_count_keys-1-example.txt
  • json_count_keys-1-example.png

What the example does

This example creates a Json object, adds a few top-level values, and displays the number of top-level keys.

Testing

Tested by running:

  • C++ version
  • Python version
  • C# top-level version
  • C# oop version

Verified that:

  • the program runs correctly
  • the Json object is created successfully
  • the output shows the correct top-level key count

Notes

This is a small usage example for the json_count_keys function in the json category.

@netlify
Copy link
Copy Markdown

netlify Bot commented May 8, 2026

Deploy Preview for splashkit ready!

Name Link
🔨 Latest commit 99cac99
🔍 Latest deploy log https://app.netlify.com/projects/splashkit/deploys/69fdbbfa72c8ae000853d11c
😎 Deploy Preview https://deploy-preview-763--splashkit.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown

@himanshigaba22 himanshigaba22 left a comment

Choose a reason for hiding this comment

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

Clean and simple example, and the deploy is passing nicely! A few things to fix up though - the .txt file has 2 lines when it should be title only, so the description line needs to go.

Also, none of the language versions call free_json() after creating the JSON object, which should be added to avoid a memory leak. Worth also confirming whether usage-example-references.json has been updated or if the dynamic scanner handles it.

Everything else looks good - the file manifest is complete, the namespace is properly wrapped, and the Python conventions are correct. Once those are sorted, it should be good to go!

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