RicoSuter / NJsonSchema

JSON Schema reader, generator and validator for .NET
http://NJsonSchema.org
MIT License
1.38k stars 532 forks source link

Default name for array & dictionary items when inlining #1556

Open lakeman opened 1 year ago

lakeman commented 1 year ago

When a registering a collection is skipped due to an .InlineNamed* setting. (eg because this test failed https://github.com/RicoSuter/NJsonSchema/blob/e045ae82b55d4e8ae9f6690a27d907c699e3c9ee/src/NJsonSchema.CodeGeneration/TypeResolverBase.cs#L76)

And the elements within that type are defined inline, with no title or other name hint.

Should we register the element type name based on the parent?

{
  "components": {
    "schemas": {
      "TypeName": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": { ... }
        }
      }
    }
  }
}