Skip to content

Improve rendering of collection-like properties using MongoJsonSchemaCreator #3766

Closed
@MateuszWicherski

Description

@MateuszWicherski

Hi!

I think that MongoJsonSchemaCreator is treating collection like fields of a @Document class incorrectly:

  • for simple and enum lists (e.g. List<String>, List<Enum>), information about expected array type is lost and they are included in a resulting schema as array
  • complex lists (e.g. List<ObjectType>), are resolved as an object with properties taken from ObjectType - the information that it is an array is lost completely (and results in not being able to insert correct document into the database).

Minimal example to reproduce the issue can be found here:
https://github.com/MateuszWicherski/spring-data-mongodb-bug

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions