Synchronise API schemas
Keep your frontend and backend in sync by regenerating API schemas after making changes to the backend API.
In this guide
Generate updated schemas
Metadata Capture uses automatic OpenAPI schema generation to maintain synchronisation between the frontend and backend. After making changes to backend API endpoints, models, or validation rules, regenerate the frontend schemas.
- Go to the frontend directory:
cd app/client/
- Generate the latest API schemas:
npm run buildOpenAPISchema
Verify the changes
After generating new schemas, verify that the changes are correct and complete.
-
Check the generated files for your new API endpoints or modified types.
-
Update your frontend code to use any new types or API functions.
-
Test the integration by running the frontend application and verifying that API calls work correctly.