Generates application code based on your project's mapping rules and schema transformations

POST /project/{projectId}/codegen/generate

Generates application code based on your project's mapping rules and schema transformations

Path parameters

  • projectId string Required

    Project ID

    Format should match the following pattern: ^[A-Za-z0-9\-]+$.

application/json

Body Required

  • collections array[string] Required

    MongoDB collections to include in generated code

  • includeSupportFiles boolean Required

    Whether to include support files, if applicable for the selected language and framework

  • language string Required

    Values are JAVA, CSHARP, JAVASCRIPT, JSON, or PYTHON.

  • framework string Required

    Values are POJO, POCO, SPRING_DATA, PERSISTENCE_LAYER, MONGOOSE_SCHEMAS, NODE, MONGODB_JSON_SCHEMA, STANDARD_JSON_SCHEMA, JSON_EXAMPLE_SCHEMA, or PYTHON_TYPED_DICT_CLASSES.

Responses

  • 200 application/json

    OK

    Hide response attributes Show response attributes object
    • language string Required

      Values are JAVA, CSHARP, JAVASCRIPT, JSON, or PYTHON.

    • framework string Required

      Values are POJO, POCO, SPRING_DATA, PERSISTENCE_LAYER, MONGOOSE_SCHEMAS, NODE, MONGODB_JSON_SCHEMA, STANDARD_JSON_SCHEMA, JSON_EXAMPLE_SCHEMA, or PYTHON_TYPED_DICT_CLASSES.

    • files array[object] Required
      Hide files attributes Show files attributes object
      • name string Required
      • filetype string Required

        Values are ENTITY, REPOSITORY, or SUPPORT.

      • code string Required
POST /project/{projectId}/codegen/generate
curl \
 --request POST 'http://127.0.0.1:8278/api/v1/project/{projectId}/codegen/generate' \
 --header "Content-Type: application/json" \
 --data '{"collections":["string"],"includeSupportFiles":true,"language":"JAVA","framework":"POJO"}'
Request examples
{
  "collections": [
    "string"
  ],
  "includeSupportFiles": true,
  "language": "JAVA",
  "framework": "POJO"
}
Response examples (200)
{
  "language": "JAVA",
  "framework": "POJO",
  "files": [
    {
      "name": "string",
      "filetype": "ENTITY",
      "code": "string"
    }
  ]
}