Open Epicycle23 opened 3 years ago
I hit the same problem.
~After a bit of debugging I found out that the problem seems to come from JSchemaGeneratorProxy not receiving the MemberProperty from the JSchemaTypeGenerationContext . When there are generation providers (see JSchemaGeneratorInternal.cs ) a JSchemaTypeGenerationContext is created and when we use the context.Generator in our custom JSchemaGenerationProvider, the JSchemaGeneratorProxy is used leading to the loss of the MemberProperty => no attribute information => the described problem occurs.~
~Adding the MemberProperty to the JSchemaGeneratorProxy and using it in JSchemaGeneratorProxy.Generate fixes the issues. Everything seems alright and all tests pass.~
Actually I don't think the above makes sense, but using the generator like this context.Generator.Generate(context.ObjectType, context.Required, context.MemberProperty); fixes the issue :)
When using a custom JSchemaGenerationProvider DataAnnotations like MinLength/MaxLength are not generated in the schema.
When this generation provider is present data annotations like MinLength,MaxLength stop working although Required still works as expected.
without ExampleSchemaProvider
with ExampleSchemaProvider