Skip to content

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

@Jakob-42

Description

@Jakob-42

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions