Bug: Schema export does not include nested properties for array-object items

Open
#562 4 comments 0 reactions 1 assignee View on GitHub

@JuanBerrocal is already working on this.

Since Nov 17, 2025.

Assessment

This issue has not been assessed yet.

Description

Ready to be assigned

Description:

When exporting a schema that contains an array of objects with nested properties, only items: { bsonType: "object" } is exported. All nested property definitions inside the array items are missing from the export.

Steps to Reproduce:

  1. Load the "theaters" example schema (or any schema with arrays containing objects with nested properties)
  2. Verify the schema includes an array field with object items that have defined nested properties
  3. Export the schema
  4. Compare the exported code to the expected output

Current Output:

"location": { bsonType: "array", items: { bsonType: "object" } }

Expected Output:

"location": { 
  bsonType: "array", 
  items: { 
    bsonType: "object",
    properties: {
      "address": { 
        bsonType: "object",
        properties: {
          "street1": { bsonType: "string" },
          "city": { bsonType: "string" }
        }
      }
    }
  }
}

Note:

Export works correctly for non-array objects. Nested properties are included when the field is a direct object type.

Dominant language
TypeScript
Stars
139
Forks
40
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Lemoncode/mongo-modeler

All issues in Lemoncode/mongo-modeler

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.