web/src/features/README.md
Implementation
Wrap with withMiddleware
Type-safe and authed API Route with createAuthedAPIRoute
Add zod types to /features/public-api/types folder.
coerce to handle primitives, such as dates, for use in your application and tests.strict() on all objects that should not return additional properties. Recommended as default. In these cases, the test utility makeZodVerifiedAPICall will throw an error if the response contains additional properties. Also, we will log an error in production if the response contains additional properties.Throw errors defined in shared/src/errors which translate to HTTP status codes
Testing
makeZodVerifiedAPICall to test the API response against the zod response schemaAPI Reference
fern including docs attributesfern generate --api server and fern generate --api client, then commit the changes to the API referenceSDKs
How to refactor existing apis to this pattern
features/public-api/typesfeatures/public-api/typesvalidateZodSchema in the API route to get type warnings in case of mismatch