Proof of Concept - Added Structured JSON API Endpoint to be used by Flutter App#766
Proof of Concept - Added Structured JSON API Endpoint to be used by Flutter App#766SantamRC wants to merge 1 commit intoCircuitVerse:masterfrom
Conversation
WalkthroughThis pull request modifies the Jekyll site configuration and introduces API documentation content for the mobile API. The 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan for PR comments
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 04782071-ba43-4fa4-886c-093b282cda36
📒 Files selected for processing (4)
_config.ymlapi-mobile/pages/docs/binary-algebra/addition.jsonapi-mobile/pages/docs/binary-representation/binary-numbers.jsonapi-mobile/pages/docs/binary-representation/index.json
| "id": "addition", | ||
| "title": "Addition", | ||
| "heading": "This is Addition for Flutter", | ||
| "api_endpoints": { | ||
| "self": "/api-mobile/pages/docs/binary-algebra/addition.json" | ||
| } |
There was a problem hiding this comment.
Complete the child-page schema before exposing this endpoint.
This payload is missing the fields that sibling child pages already carry (parent, has_children, path, and a parent API link, as seen in api-mobile/pages/docs/binary-representation/binary-numbers.json). That makes addition.json an outlier for the Flutter client and leaves it without enough metadata for routing/breadcrumbs.
| "title": "Binary Numbers", | ||
| "nav_order": "l0s000", | ||
| "level": "basic", | ||
| "parent": "Binary representation", |
There was a problem hiding this comment.
Make parent match the chapter title exactly.
This page uses "Binary representation", but api-mobile/pages/docs/binary-representation/index.json is titled "Binary Representation". If parent lookup is case-sensitive, this child will not bind to its chapter.
| "api_endpoints": { | ||
| "self": "/api-mobile/pages/docs/binary-representation/index.json", | ||
| "children": "/api-mobile/pages/docs/binary-representation/" |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# First, let's look at the file structure and the specific file
find api-mobile/pages/docs/binary-representation -type f | head -20Repository: CircuitVerse/Interactive-Book
Length of output: 191
🏁 Script executed:
# Check if there's an index.json in the children directory
ls -la api-mobile/pages/docs/binary-representation/Repository: CircuitVerse/Interactive-Book
Length of output: 313
🏁 Script executed:
# Look at the content of the file in question to understand the full context
cat -n api-mobile/pages/docs/binary-representation/index.jsonRepository: CircuitVerse/Interactive-Book
Length of output: 2282
🏁 Script executed:
# Search for similar api_endpoints patterns to understand the convention
rg "api_endpoints" --type json -A 3 | head -100Repository: CircuitVerse/Interactive-Book
Length of output: 1188
🏁 Script executed:
# Search for all api_endpoints patterns to understand the convention better
rg "api_endpoints" --type json -B 2 -A 5 | head -150Repository: CircuitVerse/Interactive-Book
Length of output: 1741
🏁 Script executed:
# Look for other parent files with children to see the pattern
rg '"has_children":\s*true' --type json -lRepository: CircuitVerse/Interactive-Book
Length of output: 127
🏁 Script executed:
# Check if there are other children endpoints and how they're structured
rg '"children":\s*"/' --type jsonRepository: CircuitVerse/Interactive-Book
Length of output: 191
Make the children endpoint a concrete JSON file reference.
The children endpoint points to /api-mobile/pages/docs/binary-representation/, a directory URL, which is inconsistent with the rest of the API. The self endpoint (and all parent endpoints in child files) correctly reference concrete .json files. On a static site, directory URL resolution is server-dependent and fragile. Either point children to a manifest file like /api-mobile/pages/docs/binary-representation/children.json, or if the embedded children array is sufficient, remove the endpoint.
Changes done:
New Endpoints
Preview Link(s):
✅️ By submitting this PR, I have verified the following