Clone (copy) schema with content into another app (API)

We have use case:
Clone (copy) schema with content into another app (immediately). New schema should have unique name (and label).

By using general API we can do that using steps (separate requests):

  1. Get original schema with fields
  2. Create new schema using original fields
  3. Get original schema content
  4. Upsert original schema content bulk into new schema

Is there another way to do it through our backend API?

Thats basically the the way you go. What would you like to improve?

I think idea of improvement could be just one endpoint like:
POST /apps/{appName}/schemas/{schemaName}/clone
with data:
appName - destination of new schema
schemaName - new schema name
copyContent (boolean, optional)

It will be helpful to manage schema clone case using one endpoint instead of bunch of separate requests.

Yes, but I try to avoid doing long running operations in the backend.

1 Like