-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Labels
Description
Problem Statement
Component props documentation is currently generated via npm run build:props and accessible through a standalone /props?components=... endpoint. However, this doesn't integrate with the hierarchical API structure used for content navigation (/api/[version]/[section]/[page]).
Goal
Integrate component props data into the versioned, hierarchical API structure to enable consumers to fetch props alongside or separately from component documentation content.
Proposed Solution
Add a props endpoint that aligns with the existing API hierarchy:
GET /api/v6/components/alert/props → Returns props for the Alert component
Completion Criteria
-
API Route Created
- Create
/api/[version]/[section]/[page]/props.tsroute - Route returns JSON array of props objects from
props.json - Lookup is case-insensitive (e.g.,
alert,Alert,ALERTall work)
- Create
-
Error Handling
- Return 404 when props don't exist for the requested component
- Return appropriate error messages for invalid paths
- Handle cases where
props.jsonhasn't been generated
-
Documentation
- Update README.mdx with new props API endpoint
- Update the api index route
- Update OpenAPI spec in
/api/openapi.json.tsif applicable
-
Testing
- Test valid requests
- Test error cases (missing props, invalid paths)
- Verify integration with existing
build:propsworkflow
-
Backwards Compatibility
- Existing
/props?components=...endpoint continues to work - No breaking changes to props.json structure
- Works whether props.json exists or not (graceful degradation)
- Existing
Out of Scope
- Changes to the
build:propscommand or props generation logic - Automatic props generation during build (optional enhancement for later)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Ready to assign